LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-21-2006, 08:04 AM   #1
guasqui
LQ Newbie
 
Registered: Mar 2006
Posts: 1

Rep: Reputation: 0
Open an URL in the default browser


Hi all,

I need to open an URL in the default browser by using a shell command. In a Windows batch file I am using the following command:
Code:
rundll32.exe url.dll,FileProtocolHandler <some-url>
Is there any similar Linux command or an analogous way of achieving the same goal?
Thanks,

Pierluigi
 
Old 03-21-2006, 01:33 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well there is nothing in "linux" to do this, as at the base OS level there is no concept of this. you would do this via a desktop environment manager toolkit, i.e. gnome or kde's bindings, as that's where those sorts of preferences would be defined.
 
Old 03-22-2006, 11:54 AM   #3
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
Eric Raymond had an idea to solve this problem, http://www.catb.org/~esr/BROWSER/index.html, too bad it doesn't seem to have taken off. Most applications that need to open something in a browser window have a config option; for a little shell script that might be overkill, though. Instead, you could parse the output of the whereis command to find out, for example.
Code:
whereis firefox | awk '{ print $1; }'
Then you could just do this for different browsers until you find one that works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Small image beside URL in browser ctkroeker Linux - General 3 12-16-2005 05:01 PM
Open HTML file in default browser through C++ Last Attacker Linux - General 10 10-20-2005 12:32 PM
Clicking an URL to evoke a browser satimis Linux - General 2 03-12-2005 05:53 AM
Browser, URL, new window question itsjustme General 4 08-29-2004 08:28 AM
FC2: Default browser doesn't open page Wopke Linux - Software 0 06-21-2004 04:04 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration