Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Getting rid of temporaries...
- X-seq: zsh-workers 19072
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh <zsh-workers@xxxxxxxxxx>
- Subject: Re: Getting rid of temporaries...
- Date: Fri, 12 Sep 2003 18:39:20 +0000
- In-reply-to: <22662.1063358877@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20030910203429.GA354@DervishD> <20030910223845.GA10805@xxxxxxxxxxxxxxxxxx> <1030911010623.ZM7489@xxxxxxxxxxxxxxxxxxxxxxx> <1378.1063261796@xxxxxxxxxxx> <20030911093927.GC50@DervishD> <22662.1063358877@xxxxxxxxxxx>
On Sep 12, 11:27am, Oliver Kiddle wrote:
}
} Wasn't as easy as I thought. Thought I could do something like:
}
} guniq() { eval "[[ -z ${~REPLY:r:r}.<${~REPLY:r:e}->.jpg(N[2]) ]]" }
} print -l *.??.jpg(e:guniq:)
}
} But eval insists on quoting the third word in what it runs so it does
} [[ -z 'foo.<28->.jpg(N[2])' ]]
} which is no use.
It's not eval that quotes that, it's [[ ]]. The argument to -z et al.
is never expanded as a glob pattern.
If you use [ -z ... ] instead, you'll get better results. Well, except
in 4.0.6, where you'll get a core dump, but that seems to be fixed in
4.0.7 and 4.1.1.
So without the function, it's
print -l *.??.jpg(e@'eval "[ -z ${~REPLY:r:r}.<${~REPLY:r:e}->.jpg(N[2]) ]"'@)
where @ is chosen as a character that appears nowhere in the expression.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author