Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 1 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.

share|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
1  
"$@" 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
    
I have tried this with firefox and I can't seem to get it to work. I used the EXACT string above (modifying the arg to -F and removing -F and the arg entirely) and for me the console still vanishes.. –  Frew Mar 30 '13 at 4:15
    
I think the problem is, that some terminal emulators don't pass on additional arguments. E.g. if you use the terminator term, it provides an -x option, which passes conveniently additional arguments to the executing command. –  romanofski Aug 13 '13 at 2:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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