zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Nex Magik <nexmagik@yahoo.com>, zsh-workers@sunsite.dk
Subject: Re: inconsistent behavior observed with export VAR=VAL versus VAR=VAL zsh 4.2.6
Date: Sat, 18 Aug 2007 10:46:18 +0100	[thread overview]
Message-ID: <20070818104618.1adb2896.p.w.stephenson@ntlworld.com> (raw)
In-Reply-To: <200708172215.l7HMFalO004036@pws-pc.ntlworld.com>

On Fri, 17 Aug 2007 23:15:36 +0100
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> Nex Magik wrote:
>> stimpy% Y="foo bar"
>...
>> stimpy% export Z=$(/bin/echo $Y):$PATH
>> export: not an identifier: bar:/tmp/opt/spi/RapiDev_99a-RC1/tools/bin:/opt/gc
>> c-3.2.3/bin:/opt/python-2.4.4/bin:/usr/local/bin:/bin:/usr/bin:/home/jkim/bin
>> /exec/i686-Linux2:/home/jkim/bin/shell:/home/jkim/bin/shell/LOGIN/i686-Linux2
>> stimpy
> 
> If this is what you're worried about, it's not a bug.  zsh applies
> completely consistent rules for arguments splitting of commands,
> including "export" and it's relatives, which means if you don't want
> $(...) expansions to be split into words then you must tell it not to.
> The standard way is to put double quotes around the expansion.  However,
> if you want to change the behaviour permanently you can set the option
> KSH_TYPESET.  See its documentation in the zshoptions manual.

Jason told me this was to do with a bash script he was trying to run in
zsh, and I notice that we don't turn on KSH_TYPESET in Bourne/POSIX
shell emulation, only ksh emulation.  It's not obvious to me from the
POSIX docs at www.opengroup.org that the bash behaviour is the approved
one, but they usually get this right and it's possible I'm missing
some obscure paragraph.  Has anyone run across this?

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2007-08-18  9:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17 19:29 Nex Magik
2007-08-17 22:15 ` Peter Stephenson
2007-08-18  9:46   ` Peter Stephenson [this message]
2007-08-18 10:03   ` 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=20070818104618.1adb2896.p.w.stephenson@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=nexmagik@yahoo.com \
    --cc=zsh-workers@sunsite.dk \
    /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).