All I want to do is pass mailto: links to urxvt -e mutt -F ~/path/to/muttrc with the rest of the mailto: URL appended. I've tried every script I can find online that purports to do this, from simple:

#!/bin/sh
exec "urxvt -e mutt -F /path/to/muttrc \"$@\""

to complex, and the most they do is open a terminal window for a split second before it automatically vanishes again (and there is no evidence of a running mutt process). Any suggestions?

link|improve this question

68% accept rate
feedback

1 Answer

up vote 0 down vote accepted

Remove the quotes, or the shell will try to execute the full string as a command (which obviously does not exist).

#!/bin/sh
exec urxvt -e mutt -F /path/to/muttrc "$@"

Not tested, but the presence of quotes is the explanation for the vanishing of the terminal.

link|improve this answer
Thanks Stephane. It works. I admit to confusion about when to quote $@ and when not to. – Wolf Sep 10 '11 at 10:40
"$@" will result in as many words as the number of arguments. With $@, all the arguments will be collapsed and word-split again (usually that's not what you want). – Stéphane Gimenez Sep 10 '11 at 10:49
feedback

Your Answer

 
or
required, but never shown

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