Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Style question: Can this be written in a more elegant way?
- X-seq: zsh-users 10186
- From: Marc Chantreux <marc.chantreux@xxxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Style question: Can this be written in a more elegant way?
- Date: Tue, 25 Apr 2006 16:58:06 +0200
- In-reply-to: <060425074145.ZM1844@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <6F0CB04509C11D46A54232E852E390AC013D956D@xxxxxxxxxxxxxxxxxxxxxxxxxx> <444C8C0B.6090409@xxxxxxxxxxxxxxxxxx> <060424082135.ZM390@xxxxxxxxxxxxxxxxxxxxxx> <444DD5D8.2030409@xxxxxxxxxxxxxxxxxx> <060425074145.ZM1844@xxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
But (( $file[1] )) can't be right; it treats the file name as a math
expression, so a file named "3-3" would execute PROG_FAIL. You must
at least mean (( ${+file[1]} )).
oopps ... that was forgotten when copy/paste ...
... you have failed to quote $REPLY so it substitutes the value that it
had before the glob began to execute. It's as if you had typed:
% : *(Nom[1]e:echo last file score:)
Correct is like so:
% : *(Nom[1]e:'echo last file $REPLY':)
last file this
last file is
last file the
last file score
i got the first error ... but what i expect is to treat only the nth
element of the list.
% : *(Nom[1]e:'echo last file $REPLY':)
last file this
% : *(Nom[2]e:'echo last file $REPLY':)
last file is
...
and so on ...
regards.
mc
Messages sorted by:
Reverse Date,
Date,
Thread,
Author