The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 02-17-2009
wempy's Avatar
wempy wempy is offline
Registered User
  
 

Join Date: Jun 2006
Location: Harpenden, UK
Posts: 208
The code below uses firefox (or mozilla if you swap the commented lines around) to open the url in an already running copy, or open a new instance if it is not already running.
Debian has a www-browser object which normally points to firefox, dunno if fedora has a similiar setuo.

Code:
#!/bin/bash
#
# mozilla=/usr/bin/mozilla
mozilla=/usr/bin/firefox
if ( $mozilla -remote "ping()" &> /dev/null );then
 $mozilla -remote "openurl(http://www.google.com, new-tab)" &
else
    $mozilla http://www.google.com &
fi