How would I add text to the beginning of each line in a text file in a script right after the file is created from another text file.
/bin/echo '%s/^/newText/g\nwq!' ex - myTextFile
I want to understand, not just use it. Yet I still can't get mine to work.
This is what I have ...
echo '%s/^/mrtsnc01/g\nwq!' ex - $ofile
what needs to be changed????
sorry - I missed the pipe:
/bin/echo '%s/^/newText/g\nwq!' | ex - myTextFile
give a full path to 'echo' - in order to avoid ksh's builtin 'echo'
thank you so so much, you saved my a$$.