Harald van Dijk wrote, on 01 Sep 2021:
> 
> The second problem is the redirection. Based on the above, command
> substitutions in a redirection are supposed to affect the exit status just
> as any other command substitution, but the standard says:
> 
>   3. Redirections shall be performed as described in Redirection.
> 
>   4. Each variable assignment shall be expanded for tilde expansion,
>      parameter expansion, command substitution, arithmetic expansion,
>      and quote removal prior to assigning the value.
> 
> This means the command substitution in your redirection is supposed to be
> performed prior to that in the variable assignment.

After the list, the standard says:

    In the preceding list, the order of steps 3 and 4 may be reversed
    if no command name results from step 2 or if the command name
    matches the name of a special built-in utility

-- 
Geoff Clare <g.cl...@opengroup.org>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England

  • $? in a simple comman... Oğuz via austin-group-l at The Open Group
    • Re: $? in a simp... Harald van Dijk via austin-group-l at The Open Group
      • Re: $? in a ... Geoff Clare via austin-group-l at The Open Group
        • Re: $? i... Harald van Dijk via austin-group-l at The Open Group
    • Re: $? in a simp... Robert Elz via austin-group-l at The Open Group
      • Re: $? in a ... Oğuz via austin-group-l at The Open Group
      • Re: $? in a ... Harald van Dijk via austin-group-l at The Open Group
      • Re: $? in a ... Robert Elz via austin-group-l at The Open Group
        • Re: $? i... Chet Ramey via austin-group-l at The Open Group
          • Re: ... Joerg Schilling via austin-group-l at The Open Group
            • ... Scott Lurndal via austin-group-l at The Open Group
              • ... Joerg Schilling via austin-group-l at The Open Group
            • ... Chet Ramey via austin-group-l at The Open Group

Reply via email to