954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Shell script to open a web page in mozilla firefox

Hey all,
I was wondering if a web page could be opened in Mozilla Firefox using a shell script!..I haven't given it a try as yet...I will also try and if I find a a solution I'll definitely put it up....Till then if someone finds a solution or knows it already can also put it up here....
Till then,
Cheers!!!
Thanx,
Shreerang Patwaardhan.

Shreerang
Newbie Poster
9 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Sure just type

firefox www.google.com

gerard4143
Nearly a Posting Maven
2,272 posts since Jan 2008
Reputation Points: 512
Solved Threads: 387
 

Hey all,
Here is the solution. Just use the folllowing command:
Syntax:
$firefox
Example:
$firefox http://www.google.com/


Thats it!!....
Cheers!!!...
Happy Shell Scripting.....

Shreerang
Newbie Poster
9 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

The simple answer is... YES!

firefox "http://url.goes.here/"


The better way to do this, assuming you had in mind a graphical *nix environment running gnome or kde (really just guessing here) would be to invoke xdg-open awesomeness. I only recently started using this, so let me know if I'm horribly wrong. There are other multi protocol handlers out there, so look up what your intended platform may already be using, or have available.

xdg-open "http://url.goes.here"


On my Linux machines running Gnome I use xdg-open to handle everything run via cron, etc. Simply run xdg-open "protocol://url.goes.here" which looks up the list of preferred handlers for that protocol in the currently running environment. If the protocol is http, and FireFox is your default browser... BOOM! FireFox opens at your URL. Or if the browser is already open, it should simply open in a new tab or window depending on the browser default settings.

Skifter
Newbie Poster
5 posts since Mar 2010
Reputation Points: 10
Solved Threads: 0
 

Hi, i need one help . i need to open a webpage automatically when my system will shutdown

yuvarajs
Newbie Poster
1 post since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You