|
|
|
@ -53,9 +53,10 @@ function prepend_2lines_of_text_before_existing_line { |
|
|
|
|
|
|
|
if ! (grep "^$existing$" $file -B2 | grep -qz "$line1.*$line2.*$existing"); then |
|
|
|
echo 'do prepend' |
|
|
|
# >&2 echo "line1=$line1" |
|
|
|
# >&2 echo "line2=$line2" |
|
|
|
# >&2 echo "existing=$existing" |
|
|
|
>&2 echo "line1=$line1" |
|
|
|
>&2 echo "line2=$line2" |
|
|
|
>&2 echo "existing=$existing" |
|
|
|
echo sed -i "/^$existing$/s/^/$line1\n$line2\n/" $file |
|
|
|
sed -i "/^$existing$/s/^/$line1\n$line2\n/" $file |
|
|
|
else |
|
|
|
echo 'already done!' |
|
|
|
|