Ticket #38229

assignments preceding special builtins persist as exported

오픈 날짜: 2018-04-26 10:49 마지막 업데이트: 2023-09-15 00:56

Reporter:
(Anonymous)
소유자:
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
3
Severity:
5 - Medium
Resolution:
Invalid
File:
None
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.

Ticket History (3/5 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
댓글 올리기

Forgot to log in again. I am the reporter.

2018-04-27 00:38 Updated by: magicant
  • Component Update from (None) to shell-main
  • 소유자 Update from (None) to magicant
댓글 올리기

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
2023-09-15 00:56 Updated by: magicant
  • Resolution Update from Postponed to Invalid
  • Status Update from Open to Closed

Attachment File List

No attachments

Edit

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