Last active
June 14, 2019 08:57
-
-
Save deanturpin/22ea3011851c2a0a3144ed9be814d080 to your computer and use it in GitHub Desktop.
Ways to chomp a newline in bash
This file contains hidden or 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
head -c -1 | |
tr "\n" " " | |
echo -n $(<command>) | |
xargs echo -n | |
[[ $(<command>) =~ <regex> ]] && echo -n $BASH_REMATCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment