unix - Why does tr -d replace the target with -? -


according tr man:

-d, --delete delete characters in set1, not translate

however

$ echo "abc" | tr "a" -d  -bc 

now removed additional command such

echo "abc" | tr "a" -d | sed 's/-//' 

but missing here? why delete replace - ?

you doing wrong. pass option before set1, manual says tr [-ccu] -d string1. command should echo "abc" | tr -d "a".

the command tr "a" -d replaces a -. try following commands, you'll figure out what's going on better..

echo "abc" | tr "a" de  echo "abc" | tr "a" +e 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -