replacing specific lines in a text document
Is there a way to write a script that would overwrite specific lines in a text file. For instance I would like to change the 1st and 4th line in a text file. How would I go about doing this while incorporating it into a script?
I hate to keep asking all these script writing questions. But it seems that there are so many tutorials out there that I don't know which one to follow. Any suggestions? :study: |
man sed
sed -e 'n c <text>' <file> Where n is the line-number, c the sed command, <text> the text you want to be on the n'th line. Cheers, Tink |
All times are GMT -5. The time now is 09:58 AM. |