zsh-users
 help / color / mirror / code / Atom feed
From: Alexander Skwar <alexanders.mailinglists+nospam@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: for loop with parameter expansion in zsh vs. bash
Date: Tue, 3 Nov 2015 08:49:09 +0100	[thread overview]
Message-ID: <CADn-QaNn=sBxw3zd=854fOa3JwSEjTKsfRaDVdtVtFiBSKR64w@mail.gmail.com> (raw)
In-Reply-To: <20151103071312.GB13762@lilyforest>

[-- Attachment #1: Type: text/plain, Size: 959 bytes --]

Hello

2015-11-03 8:13 GMT+01:00 lilydjwg <lilydjwg@gmail.com>:


>
> % 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@gmail.com <==

  reply	other threads:[~2015-11-03  7:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03  6:52 Alexander Skwar
2015-11-03  7:13 ` lilydjwg
2015-11-03  7:49   ` Alexander Skwar [this message]
     [not found] <CADn-QaM6ZEP32i+6t_DC4bA8iJF_VR5hVsP6bMyxqMATxazVCw__45247.5188104019$1446533685$gmane$org@mail.gmail.com>
2015-11-03  7:35 ` Stephane Chazelas
2015-11-03  7:47   ` Alexander Skwar
     [not found]   ` <CADn-QaNAt3y2qd4dyBnhd9ifdMOqf9DsVwFbVfdriap6uohvRA__32237.289628438$1446536964$gmane$org@mail.gmail.com>
2015-11-03  8:47     ` Stephane Chazelas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADn-QaNn=sBxw3zd=854fOa3JwSEjTKsfRaDVdtVtFiBSKR64w@mail.gmail.com' \
    --to=alexanders.mailinglists+nospam@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).