Austin Group Defect Tracker

Aardvark Mark IV

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000352 [1003.1(2008)/Issue 7] Shell and Utilities Objection Error 2010-11-09 19:13 2014-04-10 14:44
Reporter eblake View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Eric Blake
Organization Red Hat
User Reference ebb.export2
Section export
Page Number 2349
Line Number 74290
Interp Status Approved
Final Accepted Text Note: 0000619
Summary 0000352: behavior when assignments precede export
Description Historically, ksh has treated any assignments in the environment given to
export as marking those variables for export. Bash copied this behavior,
but only in POSIX mode (in non-posix mode, bash does not propagate
any assignments preceding a special built-in into the current environment);
other shells modify the current environment (as required for all special
built-ins) but without setting the export attribute:

$ ksh -c 'a=1 export b=2; export -p | grep " [ab]="; echo "$a.$b"'
export a=1
export b=2
$ bash -c 'a=1 export b=2; export -p | grep " [ab]="; echo "$a.$b"'
declare -x b="2"
$ bash --posix -c 'a=1 export b=2; export -p | grep " [ab]="; echo "$a.$b"'
export a="1"
export b="2"
$ dash -c 'a=1 export b=2; export -p | grep " [ab]="; echo "$a.$b"'
export b='2'

This proposal explicitly allows both ksh and dash behaviors.

No change is needed for readonly, since ksh matches all other shells in
only marking variables as readonly if they were listed after the command
Desired Action At line 74290, add a sentence:

If any variable assignments preceded the command name of 'export', those
variables shall be set in the current execution environment after the
completion of the command, but it is unspecified whether those variables
will be marked for export.

Tags tc1-2008
Attached Files

- Relationships
related to 0000351Appliedajosey 1003.1(2008)/Issue 7 certain shell special built-ins should expand arguments in assignment context 
related to 0000654Closedajosey 1003.1(2013)/Issue7+TC1 unclear behavior of in-line variable assignments preceding functions, special built-ins 
related to 0000960Closed 1003.1(2013)/Issue7+TC1 export can fail 

-  Notes
geoffclare (manager)
2010-11-18 17:19

Interpretation response
The standard states the requirements for the export special built-in,
and conforming implementations must conform to this. However, concerns
have been raised about this which are being referred to the sponsor.

The standard does not allow long-standing existing practice.

Notes to the Editor (not part of this interpretation):

At line 74290, add a sentence:

If a variable assignment precedes the command name of 'export' but
that variable is not also listed as an operand of 'export', then that
variable shall be set in the current shell execution environment after
the completion of the 'export' command, but it is unspecified whether
that variable is marked for export.

ajosey (manager)
2010-12-16 16:13

Comments are due on this interpretation by January 16 2011

- Issue History
Date Modified Username Field Change
2010-11-09 19:13 eblake New Issue
2010-11-09 19:13 eblake Status New => Under Review
2010-11-09 19:13 eblake Assigned To => ajosey
2010-11-09 19:13 eblake Name => Eric Blake
2010-11-09 19:13 eblake Organization => Red Hat
2010-11-09 19:13 eblake User Reference => ebb.export2
2010-11-09 19:13 eblake Section => export
2010-11-09 19:13 eblake Page Number => 2349
2010-11-09 19:13 eblake Line Number => 74290
2010-11-09 19:13 eblake Interp Status => ---
2010-11-18 17:19 geoffclare Interp Status --- => Pending
2010-11-18 17:19 geoffclare Note Added: 0000619
2010-11-18 17:19 geoffclare Status Under Review => Interpretation Required
2010-11-18 17:19 geoffclare Resolution Open => Accepted As Marked
2010-11-18 17:19 geoffclare Final Accepted Text => Note: 0000619
2010-11-18 17:20 geoffclare Tag Attached: tc1-2008
2010-12-16 16:13 ajosey Interp Status Pending => Proposed
2010-12-16 16:13 ajosey Note Added: 0000635
2011-01-18 12:30 ajosey Interp Status Proposed => Approved
2013-02-07 08:05 rhansen Relationship added related to 0000654
2013-04-16 13:06 ajosey Status Interpretation Required => Closed
2014-04-10 14:44 eblake Relationship added related to 0000351
2015-06-18 15:04 eblake Relationship added related to 0000960

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker