Update tr

This commit is contained in:
summer-wu 2015-10-07 11:39:27 +08:00
parent 8eda2266bc
commit 91c28712e6

View file

@ -1,5 +1,5 @@
#replace : with new line
echo $PATH|tr ":" "\n" #equivalent to:
echo $PATH|tr ":" "\n" #equivalent with:
echo $PATH|tr -t ":" \n
#complement "aa"
@ -11,7 +11,7 @@ echo aabbccd |tr -c "aa" 1
echo aabbccd |tr -c "ab\n" 1
#output: aabb111 with new line
#preserve all alpha(-c),sequeeze mode instead of character mode
#Preserve all alpha(-c). ":-[:digit:] etc" will translate to "\n". sequeeze mode.
echo $PATH|tr -cs "[:alpha:]" "\n"
#ordered list to unordered list