zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: (some tips about variables) Re: avoid eval?
Date: Tue, 13 Mar 2018 14:50:28 -0700	[thread overview]
Message-ID: <ec182ac5-a0d6-2d65-b960-753f76e26cc4@eastlink.ca> (raw)
In-Reply-To: <20180313203922.37npscl5jzequet3@prometheus.u-strasbg.fr>

On 13/03/18 01:39 PM, Marc Chantreux wrote:
>
> yes it can. another way to keep things very local is to use anonymous
> functions so you can write in the middle of your script
>
>      () {
>          local user
>          for user { print "hello $user" }
>      } bob joe ted

More good advice, thanks Marc, I haven't used those yet.

> wow .. don't overwrite an existing command, ever! 

To be honest,  I never considered that there was an existing command, I 
see there is, but whatever it is, I never use it.  I'll pay attention to 
that now.


> you can check the type of a variable using the (t) modifier.
>      print ${(t)path}
>      array-special
>

Thanks, I forgot about that.

> IFS is the field separator, $'\n' is the record separator so if you set
> IFS to $'\n' you can't basically split nothing captured by read.

Ha!  Now I know the difference, I thought they were the same.  You open 
my eyes Marc.  More latter.


      reply	other threads:[~2018-03-13 22:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-11 20:48 Ray Andrews
2018-03-11 22:53 ` Marc Chantreux
2018-03-12  0:43   ` Ray Andrews
2018-03-13  2:13     ` Ray Andrews
2018-03-13  2:17       ` Eric Cook
2018-03-13 16:36       ` (some tips about variables) " Marc Chantreux
2018-03-13 17:50         ` Ray Andrews
2018-03-13 20:39           ` Marc Chantreux
2018-03-13 21:50             ` Ray Andrews [this message]

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=ec182ac5-a0d6-2d65-b960-753f76e26cc4@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --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).