In a bash script, I need to run the user's web browser. There seem to be many ways to do this:
$BROWSER
xdg-open
gnome-open
on GNOMEwww-browser
x-www-browser
- ...
Is there a way more than others to work on most platforms, or do I just need to go with something like this:
#/usr/bin/env bash if [ -n $BROWSER ]; then $BROWSER 'http://wwww.google.com' elif which xdg-open > /dev/null; then xdg-open 'http://wwww.google.com' elif which gnome-open > /dev/null; then gnome-open 'http://wwww.google.com'
command-line standards bash shell
nicoulaj Jun 26 '10 at 16:15 2010-06-26 16:15
source share