3

Not sure if it was asked before but I really couldnt find anything related to this. Heres my Question. Opening a URL in firefox through linux command line works fine, like below:

firefox www.google.com

But, how do I open a URL having GET params, e. g.:

firefox www.google.com?param1=val1 

It URL Encodes the whole URL and converts the ? to %3F. On window open, the URL becomes: www.google.com%3Fparam1=val1 and not understood by the browser.

  • 1
    I don't use firefox. But I think this shoud work firefox "www.google.com?param1=val1" – Thomas15v Apr 5 '13 at 12:09
7

If you type that from a command prompt then the shell will parse the ?
(The same will happen if your URL contains an ampersand (&) or an asterix (*).

To avoid this use double quotes around the part you do not want the shell to parse.

E.g. /usr/local/bin/firefox "http://www.google.com?param1=val1"

1

Please check the result of file `which firefox`,and check if it is a script file, not a executable file. If it's a script file, then it would be very likely that it doesn't quote the arguments correctly.

0

We had the same problem. The answer for us was to fully-qualify the url, including the http:// part.

For example, this works:

firefox http://www.google.ch?q=fred

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.