Sep 9, 2015, 2:21 PM
Post #2 of 3
I frankly would not do it in sed, not that sed is no good for that, but because I have given up using sed (and awk) ever since I have been starting to use Perl, which can do these things in an easier way and can do much more.
Re: [sparsh] unix command for inserting multiple lines into beggining of file
[In reply to]
However, a quick try with sed.
My test_dups.txt file:
The sed command:
$ sed -e '1ifoo\nbar\nbaz' test_dups.txt
So the three lines are added at the beginning of the file. This is what you wanted, didn't you?
(This post was edited by Laurent_R on Sep 9, 2015, 2:29 PM)