redirection
I want do this
cat abc.txt | tr -d '\n' > abc.txt I want output in same file, How can I do? |
you would want a temporary file, e.g. abc.temp which you then rename to abc.txt in a second command.
|
you want to remove all newlines you mean?
perl -i -pe 'tr/\n//d' file |
no, his code is fine, but wants to put it back in the file he read it from. you could run it through ex nto acheive the same result i guess.
|
Quote:
Code:
cat abc.txt | tr -d '\n' > temp && mv temp abc.txt I don't know anything about sed/awk but they could manage it without a temp file. |
All times are GMT -5. The time now is 06:39 AM. |