Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Simpler for statements
- X-seq: zsh-workers 24196
- From: "Mikael Magnusson" <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: Simpler for statements
- Date: Sun, 9 Dec 2007 04:46:29 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=rgf4pCOc0g5Po+nN/gyGk1IKHvlrtmGNM/HY0RbkPZ0=; b=wuvfgDmmbR8jkn545zEf15UNtvEPh/twLHLfo7amrB/VivCFpnDahAcBbajUQwwjYqohnUQUlZZqhJs3RPMrh4PzL2nAJSgrWxe0KiFt9r0XiZt1Ubm6LQBe7ba8pMj68f2j7HoICQYnwb6KJtfmX1cINylsMNMdLlUwoFayd8c=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sCE3r1oVoNKFQUMxk2KEy1JNMbDkmAwKocECblrsnDLzLiXhl/FRuFaeeev5Zv6XihfmyrDGD4Y4M/y1L5wKx3mEcPs80AISvecMY7A+Oqha2MQlqMq1Ae2tZrPkIL6KDO8FDayaMiQ/hNykzkdRoSxtRdgFSZYoNjmRpwBQ408=
- In-reply-to: <slrnflljsb.43b.joerg@xxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <slrnflljsb.43b.joerg@xxxxxxxxxxxx>
On 08/12/2007, Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
> Hi,
>
> I look for a way to ease writing of for loops. I often have commands like
> for i in other_files.*; do cmp file $i; done
>
> Is there a better way to do this? Can I somehow improve my little
> function?
I like the
for a (other_files.*) {cmp file $a}
syntax, but I guess it depends on how easy it is to input {}() on your layout.
zsh will also allow
for a in other_files.*;cmp file $a
probably requires setopt shortloops, but a downside is you can't use ;
in the command.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author