Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Set difference between sets of files
- X-seq: zsh-users 14092
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Set difference between sets of files
- Date: Tue, 5 May 2009 19:54:10 +0100
- In-reply-to: <090505110010.ZM12545@xxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <94de1b620905050936g442490e4t3da42ac3946cb29@xxxxxxxxxxxxxx> <20090505175739.7b2e4aca@news01> <090505110010.ZM12545@xxxxxxxxxxxxxxxxxxxxxx>
On Tue, 05 May 2009 11:00:10 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> typeset -A differ
> eval differ\[${(q)^MASTER_FILES}\]=a
> eval differ\[${(q)^BACKUP_FILES}\]=b
> print -l -- ${(k)differ[(R)a]}
Wow, but I think that has problems with certain characters, too.
% MASTER_FILES=("one[two")
% eval differ\[${(q)^MASTER_FILES}\]=a
zsh: differ: assignment to invalid subscript range
I was trying to come up with something that "just works", which is
difficult if you're manipulating variable substitution and usually ends
up looking like a bus smash. (The glob qualifier solution to the orginal
problem should work fine, though.)
("Bus smash" may be British slang; it indicates ugliness.)
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author