A NOTE has been added to this issue. 
====================================================================== 
http://austingroupbugs.net/view.php?id=1150 
====================================================================== 
Reported By:                kre
Assigned To:                
====================================================================== 
Project:                    1003.1(2016)/Issue7+TC2
Issue ID:                   1150
Category:                   Shell and Utilities
Type:                       Omission
Severity:                   Editorial
Priority:                   normal
Status:                     New
Name:                       Robert Elz 
Organization:                
User Reference:              
Section:                    2.6.3 
Page Number:                2357 - 2358 
Line Number:                75182 - 75224 
Interp Status:              --- 
Final Accepted Text:         
====================================================================== 
Date Submitted:             2017-06-16 01:33 UTC
Last Modified:              2017-06-16 16:19 UTC
====================================================================== 
Summary:                    exit status of command substitution not properly
specified
====================================================================== 

---------------------------------------------------------------------- 
 (0003776) kre (reporter) - 2017-06-16 16:19
 http://austingroupbugs.net/view.php?id=1150#c3776 
---------------------------------------------------------------------- 
Re note 3773:

  | Not many people would object that
  |     a=$(exit 4) b=$?
  | may (if not should) assign 4 to $b 

I would not object to may, but would to should.

In
        a=a; a=x b=$a
it is explicitly unspecified whether b=a or b=x at
the conclusion.  It would be astounding if there was
to be a stricter requirement for $?

ash based shells (not just dash) only set $? after
this whole simple command has completed, then set
it to 4 (the result of the last cmdsub in a command
with no command word, as required.)

Exactly when $? is required to be updated is perhaps
something else that needs better specification, this
relates to the "checkpoints" that Joerg mentions in
note 3774.

I doubt much, if anything, will be broken, whatever
ends up being specified here, until the issue appeared
during an academic discussion on a related topic a day
or two ago, I had no idea that shells behaved differently.
If any scripts were being affected by that, I think we
would have heard about it before now. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2017-06-16 01:33 kre            New Issue                                    
2017-06-16 01:33 kre            Name                      => Robert Elz      
2017-06-16 01:33 kre            Section                   => 2.6.3           
2017-06-16 01:33 kre            Page Number               => 2357 - 2358     
2017-06-16 01:33 kre            Line Number               => 75182 - 75224   
2017-06-16 01:46 kre            Note Added: 0003766                          
2017-06-16 06:10 stephane       Note Added: 0003767                          
2017-06-16 09:38 joerg          Note Added: 0003768                          
2017-06-16 09:54 joerg          Note Added: 0003769                          
2017-06-16 10:06 kre            Note Added: 0003770                          
2017-06-16 10:16 joerg          Note Added: 0003771                          
2017-06-16 10:21 joerg          Note Edited: 0003771                         
2017-06-16 11:07 kre            Note Added: 0003772                          
2017-06-16 15:38 stephane       Note Added: 0003773                          
2017-06-16 15:52 joerg          Note Added: 0003774                          
2017-06-16 15:59 joerg          Note Edited: 0003774                         
2017-06-16 16:05 stephane       Note Added: 0003775                          
2017-06-16 16:19 kre            Note Added: 0003776                          
======================================================================


Reply via email to