Skip to content

Instantly share code, notes, and snippets.

@gustavderdrache
Created September 8, 2011 02:06
Show Gist options
  • Save gustavderdrache/1202431 to your computer and use it in GitHub Desktop.
Save gustavderdrache/1202431 to your computer and use it in GitHub Desktop.
function trim() {
local i
if test $# -gt 0; then
i="-i "
fi
sed $i-e 's/\s\+$//' "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment