Skip to content

Instantly share code, notes, and snippets.

@xiaom
Created January 29, 2014 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xiaom/8694700 to your computer and use it in GitHub Desktop.
Save xiaom/8694700 to your computer and use it in GitHub Desktop.
install eclipse from tarball
#!/bin/sh
tar -xzvf eclipse*.tar.gz -C /opt
chmod -R +r /opt/eclipse
# use the technique "HERE document"
# http://tldp.org/LDP/abs/html/here-docs.html
(cat <<'EOF'
#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"
$ECLIPSE_HOME/eclipse $*
EOF
) > /usr/bin/eclipse
chmod 755 /usr/bin/eclipse
( cat <<'EOF'
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse SDK 4.3.1
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
EOF
) > /usr/share/applications/eclipse.desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment