Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: duplicating functions
- X-seq: zsh-users 9535
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: duplicating functions
- Date: Thu, 20 Oct 2005 14:33:09 +0000
- In-reply-to: <kqoel1ltvbmfqr9jg46tkj2p1gh9b9t6io@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <kqoel1ltvbmfqr9jg46tkj2p1gh9b9t6io@xxxxxxx>
You can define multiple function names having the same function body
with a single "function" command (or with a single pair of empty
parens, if you're using the other syntax). This is one of the reasons
that the alias/function conflict is so insidious; if you have
alias foo='noglob bar'
foo() { print oops }
you get two functions that print oops, one of which supercedes the
noglob modifier, and neither of which is named foo.
However, in a case like yours, that quirk is potentially useful:
function g{0..9} { gmark $0 $* }
Messages sorted by:
Reverse Date,
Date,
Thread,
Author