Shell sed - bad flag in substitute command: 'r'

This simple problem is driving me mad. Hopefully someone can point out what the problem is...
Bash:
sed '/^.wget/a\
 abc' prereq-build.mk
This is my sed script which I'm trying to run using sed -f sed.scr with the idea of adding a line containing abc after searching a file which contains a line starting with wget. Sounds simple enough....
But I get:-
sed: 2: sed.scr: bad flag in substitute command: 'r'
Can anyone explain the problem, or even correct it?
 
sed 's/^ *wget.*/&\nabc/' x.sh
before
Code:
#!/bin/sh
wget -O cat.jpg https://1.2.3.4/x.jpg
#lalal
test
wget -O dog.png https://1.2.3.4/n.png
more
less
end
after
Code:
#!/bin/sh
wget -O cat.jpg https://1.2.3.4/x.jpg
abc
#lalal
test
wget -O dog.png https://1.2.3.4/n.png
abc
more
less
end
 
Back
Top