Most command line tools such as sed
do not write changes back to the input file, they only print to stdout (the screen or the next command in a pipe chain). Generally you have to output the changes to a temporary file, then replace the original with it.
does have an "-i
" option which will make it write changes back to the original file, but most other tools, like uniq
In this case, you'll probably want to do something like this:
sed -f scriptname filename | uniq -u > tempfile
mv -f tempfile filename
Finally, it usually helps if you post, in sufficient detail, everything
that's important to your task, the whole script, the commands used to execute it, the actual output you get, if any, and, most importantly, an example of the input data and the desired output format, so that others can replicate your results.
And when you do, please use ***[code][/code] tags
*** around your code and data, to preserve formatting and to improve readability. Please do not
use quote tags, colors, or other fancy formatting.