Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: for loop with parameter expansion in zsh vs. bash
- X-seq: zsh-users 20889
- From: Alexander Skwar <alexanders.mailinglists+nospam@xxxxxxxxx>
- Subject: Re: for loop with parameter expansion in zsh vs. bash
- Date: Tue, 3 Nov 2015 08:49:09 +0100
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:cc:content-type; bh=HU7PYf+3YttO3gVtjWaZKGS1CoZrgIqNC+O1ojunJlM=; b=etplPFilm4hjiiJEOJhug2JF2m3wO7vaSRxNxvOWXMPafeYKof9YmVjjS6MHiZsMfl LQvwgm6d/qu2D+83AFU5/Oc79J/J2488pozoc+D+xNv+AQsWDdYRIEzfaucIXVZ+P2Fl JJU/Dc+x5XG9NtvocRn7+7en74++IxQQz4iuwwZKFtZMqZk04E+ZKHhkQmzJYe8+SqB8 t+09BN/i7ORPSUNcvKYH0qi0JTW643v7QvLosJD61QexYSs90QqfnhjapkgzpvxQeJEH hlYvEIFPfxFa0KEh3meH1/M67cRYcFPRpFttrh/i8lSYzO8duKR4UJfV6oO7rMyoP41n d+Qw==
- In-reply-to: <20151103071312.GB13762@lilyforest>
- 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: <CADn-QaM6ZEP32i+6t_DC4bA8iJF_VR5hVsP6bMyxqMATxazVCw@mail.gmail.com> <20151103071312.GB13762@lilyforest>
- Sender: a.skwar@xxxxxxxxx
Hello
2015-11-03 8:13 GMT+01:00 lilydjwg <lilydjwg@xxxxxxxxx>:
>
> % for e in ${=PATH//:/ }; do echo e: $e; done
>
That's easy enough to type and remember, even for me ;)
>
> zsh has sh_word_split option unset by default, so use ${=var} to request
> word splitting explicitely.
>
> I like this behaviour very much, because I don't need to quote nearly
> every variable :-)
>
Thanks a lot. Might get used to it as well *G*
>
> PS: there is a coresponding $path array, and you can tie your own
> variables like this:
>
>
> export -TU PYTHONPATH pythonpath 2>/dev/null
>
> Re-tying a variable fails for zsh 4.x so I have to redirect the error
> message to the black hole. And '-U' is for uniq to remove duplicates.
>
Cool. Thanks ;)
Cheers,
Alexander
--
=> *Google+* => http://plus.skwar.me <==
=> *Chat* (Jabber/Google Talk) => a.skwar@xxxxxxxxx <==
Messages sorted by:
Reverse Date,
Date,
Thread,
Author