-
-
Save thingsiplay/6f5fdf72ac105f852f92c726ebb99f28 to your computer and use it in GitHub Desktop.
Remove surrounding whitespace from stdin.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# echo -e ' \thello world ' | trim | |
sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias trim="sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment