zsh-users
 help / color / mirror / code / Atom feed
From: Eric Cook <llua@gmx.com>
To: zsh-users@zsh.org
Subject: Re: avoid eval?
Date: Mon, 12 Mar 2018 22:17:38 -0400	[thread overview]
Message-ID: <c43d80c7-d4ad-9453-d8f0-4b7ce3b7eaa9@gmx.com> (raw)
In-Reply-To: <e4c25a58-1089-cdba-3e70-d8cce39bbc8d@eastlink.ca>

On 03/12/2018 10:13 PM, Ray Andrews wrote:
> On 11/03/18 05:43 PM, Ray Andrews wrote:
>> On 11/03/18 03:53 PM, Marc Chantreux wrote:
>>> "$@" expands as an array and "$*" expands as a string so
>>> func () cp oldfile "$*"
>>>
>>>
>> Thanks so it does.  I tried that and 50 other ideas.  I just now realized it was because I had $IFS=$'\n'
>>
>> set in another function :-(  Cost me half the day.
>>
> Is there any way to immunize my functions against $IFS trouble?  I have functions that seem to require " $IFS=$'\n' " and others that insist on " $IFS=' '  ".  It would be nice if I didn't have to reset it in each function.  I'll bet there will be syntax
> that always does the right thing regardless of $IFS.
> 
> 

In the 10 or so years that i have used zsh, i've never needed to change IFS. but in the functions that you think that you need to change IFS,
you would just use local to scope the change to that function.


  reply	other threads:[~2018-03-13  2:22 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 [this message]
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

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=c43d80c7-d4ad-9453-d8f0-4b7ce3b7eaa9@gmx.com \
    --to=llua@gmx.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).