Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: duplicating functions
- X-seq: zsh-users 9533
- From: Jean Chalard <jean.chalard@xxxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: duplicating functions
- Date: Thu, 20 Oct 2005 20:59:14 +0900
- Cc: zsh-users@xxxxxxxxxx
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=DdpBxkV7tdA+HRWRNxWr6nVZCOZMjqvrjcsCft/T9uAwXqBRBMbT2JgmasVEUcmi+k/Bp7OXZfjLbQme1PYfYOomhMiE0/k7rxO3mUB5TrTqQi1Wda227cEJkBHnAAn8SV5GDp7Rq/H8MrNiUsjmVtsh2p+bPuDIhSSZ5CHAl5Y=
- In-reply-to: <kqoel1ltvbmfqr9jg46tkj2p1gh9b9t6io@xxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <kqoel1ltvbmfqr9jg46tkj2p1gh9b9t6io@xxxxxxx>
> I have a series of functions defined .zshenv
>
> function g0() { gmark $0 $* }
> function g1() { gmark $0 $* }
> function g2() { gmark $0 $* }
> function g3() { gmark $0 $* }
> function g4() { gmark $0 $* }
> function g5() { gmark $0 $* }
> function g6() { gmark $0 $* }
> function g7() { gmark $0 $* }
> function g8() { gmark $0 $* }
> function g9() { gmark $0 $* }
>
> Where gmark contains the code and $0 is used to determine which original
> function was called
>
> Is there are simpler way of doing this
What about the following :
for i in g{0..9}; do function $i() { gmark $0 $* }; done
--
J
"If you wish to leave a record of your call,
please state your messij at the sound of the tone."
Messages sorted by:
Reverse Date,
Date,
Thread,
Author