From 84df17a0f6ee3328119d622c1cdc6d1562809d74 Mon Sep 17 00:00:00 2001 From: summer-wu Date: Wed, 7 Oct 2015 21:14:45 +0800 Subject: [PATCH] fix some typo --- cheat/cheatsheets/tr | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cheat/cheatsheets/tr b/cheat/cheatsheets/tr index c5efd47..50f617f 100644 --- a/cheat/cheatsheets/tr +++ b/cheat/cheatsheets/tr @@ -2,20 +2,20 @@ echo $PATH|tr ":" "\n" #equivalent with: echo $PATH|tr -t ":" \n +#remove all occurance of "ab" +echo aabbcc |tr -d "ab" + #complement "aa" echo aabbccd |tr -c "aa" 1 -#output: aa11111% -#tip: Complement meaning keep aa,all other is replace with 1 +#output: aa11111 without new line +#tip: Complement meaning keep aa,all others are replaced with 1 #complement "ab\n" echo aabbccd |tr -c "ab\n" 1 #output: aabb111 with new line -#Preserve all alpha(-c). ":-[:digit:] etc" will translate to "\n". sequeeze mode. +#Preserve all alpha(-c). ":-[:digit:] etc" will be translated to "\n". sequeeze mode. echo $PATH|tr -cs "[:alpha:]" "\n" #ordered list to unordered list -echo "1 /usr/bin\n2 /bin" |tr -cs "/\n[:alpha:]" "+" - -#remove all occurance of "ab" -echo aabbcc |tr -d "ab" +echo "1. /usr/bin\n2. /bin" |tr -cs " /[:alpha:]\n" "+"