Reputation: 1301
In Mac OS X Terminal, I can't seem to use the 'tr' command on a file.
For example, I have a text file called 'z.txt' on my desktop. I would like to substitute every letter 'a' into the letter 'e'.
tr "a" "e" z.txt
returns the following message:
usage: tr [-Ccsu] string1 string2
tr [-Ccu] -d string1
tr [-Ccu] -s string1
tr [-Ccu] -ds string1 string2
Conversely, this works just fine:
sed "s_a_e_g" z.txt
What syntax or quoting should I use to make the 'tr' approach work?
Upvotes: 3
Views: 9101