>>18 if you have sed you don't need cat nor echo... ... ... echo is kinda annoying since you need a readable, preferably single line text file to start the process cpu% sed '1 c\ this is a test \ file written with sed as echo \ it has newlines and everything' /dev/osversion > file1 cpu% sed -e 's/test/a second/' -e 's/written/modified/' -e 's/with/by/' -e 's/as echo//' file1 > file2 cpu% sed '$ q' file1 file2 > file3 cpu% sed '$ q' file3 this is a test file written with sed as echo it has newlines and everything this is a second test file modified by sed it has newlines and everything cpu%
if you have sed you don't need cat nor echo... ... ...
echo is kinda annoying since you need a readable, preferably single line text file to start the process
cpu% sed '1 c\
this is a test \
file written with sed as echo \
it has newlines and everything' /dev/osversion > file1
cpu% sed -e 's/test/a second/' -e 's/written/modified/' -e 's/with/by/' -e 's/as echo//' file1 > file2
cpu% sed '$ q' file1 file2 > file3
cpu% sed '$ q' file3
this is a test
file written with sed as echo
it has newlines and everything
this is a second test
file modified by sed
it has newlines and everything
cpu%