replace only the first line of a file without temporary files
hello I have a file in which I want to replace the first line with the context of another file. I have done this with temporary files, with I want to know if there is an easier and more efficient way to do this with sed, awk or other stream editor.
I have a main file whose content is: header text... ... text... I have a file that has the text I want to insert in the fist line. The output I want is newHeader text... ... text... How can I do this without using temporary files? Thanks |
Hi,
As always there are probably others ways of doing this, but this should work: - A sed solution - Code:
#!/bin/bash Files used and testrun: Quote:
|
All times are GMT -5. The time now is 09:04 AM. |