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.

Recommended Answers

All 5 Replies

Hey all,
Here is the solution. Just use the folllowing command:
Syntax:
$firefox <name of the web page>
Example:
$firefox http://www.google.com/


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

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.

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

to open a webpage automatically, after a system restart, in windows, you can create a .bat file with just this text inside:

explorer http:\\www.google.com

to create that, open notepad, paste text above, and save as .bat

then, create a shortcut of this file,
and put that into Startup folder you find this folder as it follow:

click Windows Start Button-->Startup folder

if you need, you can write into the file something to delay the startup of explorer:

ping 192.0.2.2 -n 1 -w 10000 > nul
explorer http:\\www.google.com

10000 are "milliseconds", so, it will wait 10 seconds.
if you need 25 seconds= 25000 ... and so.
don't care about the other commands, they are just there to give something to do to the pc instead of sleeping, but they do nothing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.