Results 1 to 2 of 2

Thread: Sed an empty line and two new ones before string

  1. #1
    Join Date
    Dec 2008
    Location
    /dev/null
    Beans
    332

    Sed an empty line and two new ones before string

    Hey,

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

    Code:
    [...]
    
    cd $script_path;
    
    # Fix coordinates for non-US locales
    export LC_NUMERIC=en_US.UTF-8
    
    LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./googleearth-bin "$@"
    Thanks.
    Last edited by Intrepid Ibex; December 23rd, 2012 at 09:43 AM.
    PC: Asus M5A87, AMD Phenom II X6 1090T, 10GB DDR III 1333MHz, Nvidia GTX560 Ti 1024M, Samsung SSD 830 Series 256GB, HDD 1 TB SATA II 7200RPM
    OS: Arch 64-bit/Windows 8.1 Pro 64-bit
    Other: KB: Logitech G110, M: Logitech G500, 100/10M Internet

  2. #2
    Join Date
    Dec 2008
    Location
    /dev/null
    Beans
    332

    Re: Sed an empty line and two new ones before string

    Lolness. Well it was just:

    Code:
    sed -i "/googleearth-bin/i\# Fix coordinates for non-US locales\nexport LC_NUMERIC=en_US.UTF-8\n" googleearth
    PC: Asus M5A87, AMD Phenom II X6 1090T, 10GB DDR III 1333MHz, Nvidia GTX560 Ti 1024M, Samsung SSD 830 Series 256GB, HDD 1 TB SATA II 7200RPM
    OS: Arch 64-bit/Windows 8.1 Pro 64-bit
    Other: KB: Logitech G110, M: Logitech G500, 100/10M Internet

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •