Tíquete #38229

assignments preceding special builtins persist as exported

: 2018-04-26 10:49 Última Atualização: 2018-10-06 18:05

Relator:
(Anônimo)
Dono:
Tipo:
Estado:
Aberto [Owner assigned]
Componente:
Marcos:
(Nenhum)
Prioridade:
3
Gravidade:
5 - Medium
Resolução:
Postponed
Arquivo:
Nenhum
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/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
Comentário

Forgot to log in again. I am the reporter.

2018-04-27 00:38 Updated by: magicant
  • Componente Update from (Nenhum) to shell-main
  • Dono Update from (Nenhum) to magicant
Comentário

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
  • Prioridade Update from 5 - Medium to 3
  • Resolução Update from Nenhum to Postponed

Attachment File List

No attachments

Editar

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