From: Stephane Chazelas <stephane@chazelas.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: More typeset bugs: POSIX_BUILTINS
Date: Mon, 30 Nov 2020 17:14:57 +0000 [thread overview]
Message-ID: <20201130171457.yofem5soaiiaprxc@chazelas.org> (raw)
In-Reply-To: <CAH+w=7aZ40Dnff8+n+7xFqm_7Bg_OMr3oyKDc2nrLzAsSkoqmQ@mail.gmail.com>
2020-11-29 12:18:29 -0800, Bart Schaefer:
> On Sun, Nov 29, 2020 at 12:12 PM Stephane Chazelas
> <stephane@chazelas.org> wrote:
> >
> > FWIW, though I'd agree it's a bug, it's not a POSIX
> > non-compliance as the behaviour for "readonly/export -p var" is
> > unspecified by POSIX, POSIX only specifies "readonly/export -p"
> > without arguments.
>
> Both bash and ksh ignore -p for readonly/export when there are any
> non-option arguments, and therefore create/assign the named variables.
>
> So this is at least a ksh emulation incompatibility.
Yes, I had assumed "-p" was for "print", but it looks like it's
more for "POSIX" / "portable" (though neither bash nor zsh give
portable output upon "export -p" when not in posix mode)
With that in mind, it makes more sense now that
export -p foo
could be expected to do anything else than print the definition
of foo.
Still, I can't see why anyone would write that as the "-p" has
no effect if the intention is to export foo.
While yash and zsh agree on "export -p HOME" printing the
definition of HOME, "export -p HOME=bar" sets HOME to bar
in yash and ignores -p, while in zsh, it prints the current
value of HOME and ignores =bar.
--
Stephane
prev parent reply other threads:[~2020-11-30 17:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAH+w=7aYGZgF25Hypw=s31u5hfTT-Y+6pKzrCuD-1kB=1pShOg@mail.gmail.com>
2020-11-29 20:12 ` Stephane Chazelas
2020-11-29 20:18 ` Bart Schaefer
2020-11-30 17:07 ` Bart Schaefer
2020-11-30 17:14 ` Stephane Chazelas [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=20201130171457.yofem5soaiiaprxc@chazelas.org \
--to=stephane@chazelas.org \
--cc=schaefer@brasslantern.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).