Ticket #38229

assignments preceding special builtins persist as exported

Open Date: 2018-04-26 10:49 Last Update: 2018-10-06 18:05

Reporter:
(Anonymous)
Owner:
Type:
Status:
Open [Owner assigned]
Component:
MileStone:
(None)
Priority:
3
Severity:
5 - Medium
Resolution:
Postponed
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

$ yash -c 'v=foo :; env | grep ^v='
foo

The assignment should persist as : is a special builtin, but I don't think it should be exported.

Attachment File List

No attachments

Ticket History (3/4 Histories)

2018-04-26 10:49 Updated by: None
  • New Ticket "assignments preceding special builtins persist as exported" created
2018-04-26 10:50 Updated by: mcdutchie
Comment

Forgot to log in again. I am the reporter.

2018-04-27 00:38 Updated by: magicant
  • Owner Update from (None) to magicant
  • Component Update from (None) to shell-main
Comment

The current behavior is explicitly allowed in the POSIX standard.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_01

If the command name is a special built-in utility, variable assignments shall affect the current execution environment. Unless the set -a option is on (see set), it is unspecified: (1) Whether or not the variables gain the export attribute during the execution of the special built-in utility (2) Whether or not export attributes gained as a result of the variable assignments persist after the completion of the special built-in utility

It is surprising to me, though, that many other shells behave differently than yash.

2018-10-06 18:05 Updated by: magicant
  • Resolution Update from None to Postponed
  • Priority Update from 5 - Medium to 3

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login