Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Neat hash -d trick
- X-seq: zsh-users 15472
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Neat hash -d trick
- Date: Fri, 22 Oct 2010 12:29:18 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=inSQLvQDbW4/13JtBLhk9NbxH8eOTXgOipOaNbJ4XiA=; b=p3vpqmhM64prgQLTdkBqs3252g8N83en5sjvIvafiavc4bEuM1IsvzMFO29baBcd+d XEHNOyNTyF7CR27epmq+hrI3ZFls7J9GJGeVkiQSXVEjJqLb0T6Xgb8FSxP2y4zLAd8k ucoBWnsKGT+d6+Bcg85ucobf0ZER9FgpiK+38=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Z5+9UFJEAmtzCyVGo7hprnGCkWqihNSr6MH+kMTBbl5lj6ZcRUfKAUZ77W/xqG9dWR XuBzJ6pY8n3NNMS8vCJxNlqSTIqHxXSDWF+JYWK3y6MOKftn5A/XPHrTnIq5JjH1uISb VcVR9VMN3z7cLhs/GgCenGl1SkdGLwGKLHMzo=
- In-reply-to: <101021210513.ZM30802@xxxxxxxxxxxxxxxxxxxxxx>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <AANLkTikBOSBNfBHXDFdfiCkijVt5G5+-1UVFz_VqY3wZ@xxxxxxxxxxxxxx> <101021210513.ZM30802@xxxxxxxxxxxxxxxxxxxxxx>
- Sender: nikolai.weibull@xxxxxxxxx
On Fri, Oct 22, 2010 at 06:05, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Oct 22, 12:34am, Nikolai Weibull wrote:
> }
> } for ((i = 1; i < 9; i++)); do
>
> You probably mean <= 9 there? ÂOr just
Yes.
> Âfor i in {1..9}
Ah, of course.
> } Â hash -d .$i=${(j:/:)${(l:2::.:)${(s::)${(l:i::.:)}}}}
>
> Â Âhash -d .$i=${${(l:i*3::../:)}%/}
Again, obvious, once you see it. I had a feeling my way was
unnecessarily complicated ;-).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author