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.

I am trying to lookup some C functions so that I could debug while using strace. So I setup a bash function to look it up in firefox (or links), but the substitution falls apart with : and escaping does not work, at least not in a simple way.

Working

ff() {
    firefox "https://www.google.com/search?hl=en&q=%*"
}

Not working

cr() {
    firefox "codewiki.wikidot.com/c:system-calls:%*"
}

firefox gets : parsed in as input, but also $* gets parse in as literal characters.

Tried:

1. Escaping : % *
2. Enclosing ${%*}
3. Changing " '
4. EnvVariable COMP_WORDBREAKS=${COMP_WORDBREAKS//:}

Edit: My question is flawed. My working code had $* all along. I wish to delete my question, but I leave it for reference to people who might be encouraged to write answers and improve questions on similar problem.

share|improve this question

closed as too localized by Ulrich Dangel, Gilles, vonbrand, jasonwryan, Kyle Jones Apr 2 '13 at 2:42

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
Not an answer for you, but surfraw does exactly this... –  jasonwryan Apr 1 '13 at 21:41
    
Thanks. This is like getting a bonus. –  Forethinker Apr 1 '13 at 21:42
    
Glad it helped... –  jasonwryan Apr 1 '13 at 21:57
    
I also recommend man 2 ... for a quick system call look up. –  Forethinker Apr 1 '13 at 22:18

1 Answer 1

Changing %* to $* fixed the problem.

share|improve this answer
    
If you read your question well, you'll notice that you wrote $* in the question and %* in the code. :) –  peterph Apr 1 '13 at 21:57

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