Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Set difference between sets of files
- X-seq: zsh-users 14098
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Set difference between sets of files
- Date: Wed, 06 May 2009 11:25:28 +0100
- In-reply-to: <090506031146.ZM13088@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <94de1b620905050936g442490e4t3da42ac3946cb29@xxxxxxxxxxxxxx> <20090505175739.7b2e4aca@news01> <090505110010.ZM12545@xxxxxxxxxxxxxxxxxxxxxx> <20090505195410.2b220325@pws-pc> <090506031146.ZM13088@xxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> Thd following is arcane, but seems to do the trick:
>
> MASTER_FILES=('a[b' '$cd' 'ef}' 'g h' 1 2 3)
> BACKUP_FILES=('a[b' '$cd' 'ef}')
>
> typeset -A differ
> eval 'differ[${:-'${(q)^BACKUP_FILES}'}]=b'
> eval 'differ[${:-'${(q)^MASTER_FILES}'}]=a'
> print -l -- ${(k)differ[(R)b]}
Interesting, it's worth remembering that ${:-<something quoted>} gets
you out of jail with quoting parameter subscripts.
> } ("Bus smash" may be British slang; it indicates ugliness.)
>
> I got the ugliness, but if that's rhyming slang I haven't managed to
> un-rhyme it.
It relies on a visual rather than and auditory metaphor. I won't post a
link to a picture, which would be in bad taste.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
Messages sorted by:
Reverse Date,
Date,
Thread,
Author