Ticket #38229

assignments preceding special builtins persist as exported

Date d'ouverture: 2018-04-26 10:49 Dernière mise à jour: 2023-09-15 00:56

Rapporteur:
(Anonyme)
Propriétaire:
Type:
État:
Atteints
Composant:
Jalon:
(Aucun)
Priorité:
3
Sévérité:
5 - moyen
Résolution:
Invalid
Fichier:
Aucun
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

$ 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
Commentaire

Forgot to log in again. I am the reporter.

2018-04-27 00:38 Updated by: magicant
  • Composant Update from (Aucun) to shell-main
  • Propriétaire Update from (Aucun) to magicant
Commentaire

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
  • Résolution Update from Aucun to Postponed
  • Priorité Update from 5 - moyen to 3
2023-09-15 00:56 Updated by: magicant
  • Résolution Update from Postponed to Invalid
  • État Update from Ouvert to Atteints

Attachment File List

No attachments

Modifier

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