Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
More typeset bugs: POSIX_BUILTINS
- X-seq: zsh-workers 47701
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: More typeset bugs: POSIX_BUILTINS
- Date: Sun, 29 Nov 2020 10:19:44 -0800
- Archived-at: <https://zsh.org/workers/47701>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-11/CAH%2Bw%3D7aYGZgF25Hypw%3Ds31u5hfTT-Y%2B6pKzrCuD-1kB%3D1pShOg%40mail.gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-oi1-f179.google.com) smtp.remote-ip=209.85.167.179; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=GQU5QMBzQe3mFeuL7esEnJUMdwTvUfk0WPg+SCIQLts=; b=uURwHp7tGa0uM1DbW3+IJH+YrVxkjPmaMaMDUvTsoa4M3v56w6Op0OnVIra0umwY0t /dUKFGR5AC3nSuXn6ak7IMywNy2VSiJQp4fqlC0hEwwwvQAxE0ZkhHKXr+/lsRjmMaLf Cnlb/QcCeOEigHhqDx/UvjL+7lcGIs5swHfcaKjZrNM2fd3Ac+m+tfUGKA6XnV5wgh6o DR5+pYgy/+RLdZt84BYLkC8WpQKU9GA5PJa3eiHbyCa6xVzNPHaPy6LhXvoeC68NzR7Y zvRNXQ8Yd6RZsoZXIhNOmeRyPUZe4zv2Z2y6UJzG03PeCmeTzXGjIWbc7oFdjPqAh4U/ vxog==
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- Sender: zsh-workers-request@xxxxxxx
In printparamnode is this comment:
* Special POSIX rules: show the parameter as readonly/exported
* even though it's unset, but with no value.
There's a test for this with "readonly", so apparently "readonly FOO"
has always had the property that the variable exists but seems to be
unset if and only if POSIX_BUILTINS is in force. Similarly for
"export" although there's no test for it.
(This suggests that perhaps POSIX_BUILTINS is a reasonable choice for
enabling this behavior with typeset in general, even though typeset
and local are not actually part of POSIX.)
However, there's some confusion (this is with the master branch head):
% setopt POSIX_BUILTINS
% export OUTER
% typeset -p OUTER
% readonly -p OUTER
readonly OUTER
% typeset INNER
% export -p INNER
export INNER=''
% readonly FROZEN
% typeset -p FROZEN
% export -p FROZEN
export FROZEN
%
That is, each command prints its own name even when that's not
appropriate to the variable (and typeset prints nothing for names with
no value, although that's OK since it's not a POSIX builtin).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author