You are not logged in.
Hi!
I need to know how I can 'parse' commandline args that my script receives 'onto' the executable that the script calls.
#!/bin/bash
xhost + local:
schroot -p -- firefox
As you can see, my script uses schroot to start up firefox (in my 32bit chroot, damn you adobe!)
This works fine, BUT, I want to have 'normal' behaviour, which means for example clicking on a link in a pidgin chat window actually opens that link.
For this to work, I set my script to be called in GNOME's preferred apps menu. Sadly all that happens is that a new firefox window is opened.
So I need to parse the link, normally I would have:
firefox -new-tab "%s"
in the preferred apps menu.
So I need to modify my script to parse "%s". How would I do this??
Last edited by hungerfish (2010-07-30 11:25:03)
Beetles and bacteria are vastly more successful than humans in terms of survival.
Offline
I assume you want to pass the first argument to your script on to firefox:
#!/bin/bash
xhost + local:
schroot -p -- firefox -new-tab $1
Also see bash(1), "Positional Parameters"
Offline
Hey, thanks works perfectly
Beetles and bacteria are vastly more successful than humans in terms of survival.
Offline
this should work better:
schroot -p -- firefox "$@"
that way, all the arguments get passed to firefox
"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page
Offline
Ok, cool!
Beetles and bacteria are vastly more successful than humans in terms of survival.
Offline