Skip to content

Instantly share code, notes, and snippets.

@xiaom
Created January 29, 2014 19:07
Embed
What would you like to do?
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