Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Two array/glob expansion questions
- X-seq: zsh-users 14326
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- Subject: Re: Two array/glob expansion questions
- Date: Thu, 27 Aug 2009 07:51:37 +0200
- Cc: zsh-users@xxxxxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ulBzsQRCOODZ3ovTYpUqdt0+/3j1zB/yP+6NNsSnRmo=; b=icMDXzL/B585ptBvoIkMHZaFEAcvRvOE52CKNdonJy5T1dKqjGGVRL/MpoQ8hQcSOf TrBSMtSvzrl9z4/kqa6KnaajBsauq0hcofSLOjtYsl2mTIOi8OgtB4K2FlPnseKh8Z4F uHKNWow0PeiJSaIkv7OkHXqbzEGDkGJAmjNH8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=kkBwzRCQGI7jN+MOQIAbC48U1Tn2fwNV23PI16PH5LEFsprn9l/xTLAcqWDQehbgZ8 1A5c+COYjwn5DgHsWs1l52z7y8YzeanJCYavXRWLq1PUBxpJKr2ZIE4RoMmMtzuaaBNs VAYmNXlPGxzM2CQWHhQl6Q0v39i9slIwuw/tI=
- In-reply-to: <alpine.LNX.2.01.0908261803460.18590@xxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <alpine.LNX.2.01.0908261803460.18590@xxxxxxxxxxx>
2009/8/27 Benjamin R. Haskell <zsh@xxxxxxxxxx>:
> There are two things with arrays/lists/globs I've recently been unable to
> tease out the syntax for. Neither seems particularly diabolical, and both
> are easy with looping or xargs, but I was wondering if there were shorter
> versions:
>
> 1. Given an array of things, create an array of those things as flag
> arguments:
>
> e.g., via loops # disregarding "There are better ways to specify this"
> $ list=( some directories to ignore )
> $ for dir in $list ; args+=( --exclude $dir )
> $ rsync $args -av blah/ blah/
You can do it easily if you don't need two new words to be created,
ie if --exclude=$dir is valid, you can do rsync --exclude=$^list -av blah/ bluh/
(doing --exclude\ $^list won't work)
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author