Advertisement
Guest User

Untitled

a guest
Dec 23rd, 2012
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.13 KB | None | 0 0
  1. #!/bin/sh
  2. # Always run Google Earth from this shell script and not
  3. # Google Earth directly! This script makes sure the app looks
  4. # in the right place for libraries that might also be installed
  5. # elsewhere on your system.
  6. #
  7. # Ryan C. Gordon,  Thu Jul 20 14:32:33 PDT 2006
  8.  
  9. # Function to find the real directory a program resides in.
  10. FindPath()
  11. {
  12.     fullpath="`echo $1 | grep /`"
  13.     if [ "$fullpath" = "" ]; then
  14.         oIFS="$IFS"
  15.         IFS=:
  16.         for path in $PATH
  17.         do if [ -x "$path/$1" ]; then
  18.                if [ "$path" = "" ]; then
  19.                    path="."
  20.                fi
  21.                fullpath="$path/$1"
  22.                break
  23.            fi
  24.         done
  25.         IFS="$oIFS"
  26.     fi
  27.     if [ "$fullpath" = "" ]; then
  28.         fullpath="$1"
  29.     fi
  30.  
  31.     # Is the sed/ls magic portable?
  32.     if [ -L "$fullpath" ]; then
  33.         #fullpath="`ls -l "$fullpath" | awk '{print $11}'`"
  34.         fullpath=`ls -l "$fullpath" |sed -e 's/.* -> //' |sed -e 's/\*//'`
  35.     fi
  36.     dirname $fullpath
  37. }
  38.  
  39. script_path=$(FindPath $0);
  40.  
  41. cd $script_path;
  42.  
  43. LD_LIBRARY_PATH=.:$LD_LIBRARY_PATH ./googleearth-bin "$@"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement