Created
June 12, 2015 00:58
-
-
Save hitswa/f142521d196e29a3ba05 to your computer and use it in GitHub Desktop.
opening a link via shell script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#to open localhost in browser | |
# this section not working for now | |
#if [ -n $BROWSER ]; then | |
# $BROWSER 'http://wwww.google.com/' | |
# | |
#elif | |
if which xdg-open > /dev/null; then | |
xdg-open 'http://localhost/' | |
elif which gnome-open > /dev/null; then | |
gnome-open 'http://localhost/' | |
elif which www-browser > /dev/null; then | |
www-browser 'http://localhost/' | |
elif which x-www-browser > /dev/null; then | |
x-www-browser 'http://localhost/' | |
else | |
echo "Could not detect the web browser to use." | |
fi | |
# can also use following script to open link in default browser | |
# sensible-browser 'http://localhost/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment