zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Martijn Dekker <martijn@inlv.org>
Cc: Peter Stephenson <p.stephenson@samsung.com>,
	zsh workers <zsh-workers@zsh.org>
Subject: Re: ${path[@]} in sh mode [was: Segfault with zsh 5.2]
Date: Sat, 23 Jan 2016 01:07:41 +0100	[thread overview]
Message-ID: <CAHYJk3Qi-N3J2Np6w1Jqm_J+4=ip+kpGwhpQhi74L3osmfnYgw@mail.gmail.com> (raw)
In-Reply-To: <56A294F9.5020509@inlv.org>

On Fri, Jan 22, 2016 at 9:45 PM, Martijn Dekker <martijn@inlv.org> wrote:
> Martijn Dekker schreef op 22-01-16 om 20:12:
>> Peter Stephenson schreef op 07-12-15 om 14:36:
>>> Change now pushed.
>>
>> Can the ${path[@]} array be disabled in sh mode? I just noticed that it
>> auto-syncs with the system $PATH. Lowercase "path" is a perfectly normal
>> variable name in other shells and is a common English word, so conflicts
>> that result in corruption of $PATH are not unlikely when running scripts
>> written using other shells.
>
> Never mind: it is disabled when zsh is launched as sh (but not when
> launched as zsh and then executing 'emulate sh'). So I suppose it was
> decided long before that disabling it post-launch is not feasible. Sorry
> for the noise.

If you're in a function context, you can say 'typeset -h path' to hide
the specialness of $path and declare a new local of the same name. Eg,
one that isn't connected to PATH.

-- 
Mikael Magnusson


  reply	other threads:[~2016-01-23  0:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-07 13:01 Segfault with zsh 5.2 Christian Neukirchen
2015-12-07 13:55 ` Peter Stephenson
2015-12-07 14:31   ` Christian Neukirchen
2015-12-07 14:36     ` Peter Stephenson
2015-12-07 14:54       ` Christian Neukirchen
2016-01-22 20:12       ` ${path[@]} in sh mode [was: Segfault with zsh 5.2] Martijn Dekker
2016-01-22 20:45         ` Martijn Dekker
2016-01-23  0:07           ` Mikael Magnusson [this message]
2016-01-23  1:08             ` Martijn Dekker
2016-01-23  1:53               ` Bart Schaefer
2016-01-24 15:15                 ` Peter Stephenson

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='CAHYJk3Qi-N3J2Np6w1Jqm_J+4=ip+kpGwhpQhi74L3osmfnYgw@mail.gmail.com' \
    --to=mikachu@gmail.com \
    --cc=martijn@inlv.org \
    --cc=p.stephenson@samsung.com \
    --cc=zsh-workers@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).