Hi and thank to all of you responding.
My explanation and understanding:
myfile.txt example:
Hello guys
<= one space here
Anybody from Europe? <= two spaces between Anybody and from
tr -c "[:alpha:]" "\n" < myfile.txt
myfile.txt is INPUT
tr finds the complement to :alpha: and replaces them by \n,
resulting in:
START-OF-FILEmyfile
txt
Anybody
from
Europe
EOF
Should I have included -s, it would have removed multiple occurences
of \n from the OUTPUT and the result would have been:
myfile
txt
Anybody
from
Europe
EOF
As the tr(1) states: This (the squeeze) occurs AFTER all deletion and
translation is completed.
So I still believe there should be OUTPUT in the -s description.
I will use this unimportant topic to learn how one can "send diffs".
Sincerely,
Tomas
No comments:
Post a Comment