View Full Version : Sed an empty line and two new ones before string

Intrepid Ibex
December 23rd, 2012, 08:17 AM

What I'd like to do is to make the ending in the Google Earth script (http://pastebin.com/Ltnptt5j) look like so (preferably by specifying to add the bolded lines before the line with the string 'googleearth-bin'):


cd $script_path;

# Fix coordinates for non-US locales
export LC_NUMERIC=en_US.UTF-8

LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./googleearth-bin "$@"


Intrepid Ibex
December 23rd, 2012, 02:54 PM
Lolness. Well it was just:

sed -i "/googleearth-bin/i\# Fix coordinates for non-US locales\nexport LC_NUMERIC=en_US.UTF-8\n" googleearth