I\'m trying to insert a file content before a given pattern
Here is my code:
sed -i \"\" \"/pattern/ { i\\\\ r $scriptPath/adapters/default/permissi
CodeGnome's solution don't work, if the pattern is on the last line.. So I used 3 commands.
sed -i '/pattern/ i\ INSERTION_MARKER ' $manifestFile sed -i '/INSERTION_MARKER/r $scriptPath/adapters/default/permissions.xml' $manifestFile sed -i 's/INSERTION_MARKER//' $manifestFile