Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Help on zsh grammar
- X-seq: zsh-users 621
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: Dietmar Rempfer <dietmar@xxxxxxxxxxxxxxxxxxxxxxxx>, borsenkow.msk@xxxxxx, zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Help on zsh grammar
- Date: Wed, 22 Jan 1997 11:35:59 -0800
- In-reply-to: Andrej Borsenkow <borsenkow.msk@xxxxxx> "Re: Help on zsh grammar" (Jan 22, 6:53pm)
- References: <Pine.SV4.3.95.970122185019.1005B-100000@xxxxxxxxxxxxxxxxx>
- Reply-to: schaefer@xxxxxxx
Redirected to zsh-users ...
On Jan 22, 6:53pm, Andrej Borsenkow wrote:
} Subject: Re: Help on zsh grammar
}
} On Wed, 22 Jan 1997, Dietmar Rempfer wrote:
}
} > Let us define the following function:
} >
} > test () { echo \"$*\" }
} >
} > Now, if I do ``test blabla'', I get "blabla", which is what I want.
} > But if I say e.g. ``test *.aux'', I would like to see "*.aux" printed out,
} > but instead I get the message: zsh: no matches found: *.aux.
You're getting that error before `test' even runs, from the top-level shell
that's parsing the command line. `$*' is -not- being globbed inside `test'.
} What about
} test '*.aux' :-)
}
} But really, you want
}
} unsetopt nomatch
No, he doesn't. What he wants is
test () { echo \"$*\" }
alias test 'noglob test'
Note that the alias must come after the function definition, or else you
define two functions (`noglob' and `test'), both of which do the echo.
(You can use `function test () { ... }' instead, but it's still a good
idea to always define aliases after defining functions.)
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.nbn.com/people/lantern
Messages sorted by:
Reverse Date,
Date,
Thread,
Author