I have an sed
question to which I couldn't find the answer anywhere yet:
I have a bunch of files, some of them start with the string ###
and some don't. In every file which starts with ###
I would like to insert some multi-line string before the current first line.
f.e. If a file looks like
### the first line
abc cba jfkdslfjslkd
I want the multi line string to get inserted at the top
my
multi
line
string
### the first line
abc cba jfkdslfjslkd
Nothing else in the file should get modified.
If a file does not start with ###
then I don't want to edit it.