> On Jun 27, 2021, at 2:33 PM, [email protected] wrote:
> 
> Don Cragun via austin-group-l at The Open Group dixit:
> 
>>      • When an unrecoverable error condition is
>>        encountered, the utility shall exit with a
>>        non-zero exit status.

Please do not cherry pick what you quote from my message!
The lead in to the above quote was:
   The following shall apply to each utility, unless
   otherwise stated:
        ... ... ...

When the CONSEQUENCES OF ERRORS section of the specification of the pwd utility 
says:
        If an error is detected, output shall not be
        written to standard output, a diagnostic message
        shall be written to standard error, and the exit
        status is not zero.
the standard clearly states OTHERWISE for the behavior of that utility.  When 
the standard states OTHERWISE, the requirements following "The following shall 
apply to each utility, UNLESS OTHERWISE STATED" do not apply.
> 
> Is “pwd >/dev/full” an “unrecoverable error condition” as regards
> the pwd utility?
> 
> I think not. It validated the current working directory and attempted
> to hand the information over; what the user does with it is the user’s
> fault.

Note also that without options, the pwd utility does not validate the current 
working directory unless the PWD environment variable is not present, does not 
contain an absolute pathname, or contains a component of the pathname that is 
"." or "..".  Under normal circumstances, the pwd utility is just supposed to 
copy the contents of the PWD environment variable to stdout.

And, if /dev/full is not an existing file that is writable or the name of a 
file that can be successfully created by the user invoking pwd, then the shell 
will report an error and not even try to invoke pwd.

> 
> More context: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990265
> and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=990264 (though
> they are pretty much the same information).

The pwd utility CONSEQUENCES OF ERRORS quote from the standard is also noted in 
both of the above references.  And, I agree with Vincent in those references 
when he says that when using the pwd built-in utility "one would expect a 
diagnostic message (and I think that one should also get one for the other 
builtins)".

Sincerely,
Don

> 
> Thanks in advance,
> //mirabilos
> -- 
> Gestern Nacht ist mein IRC-Netzwerk explodiert. Ich hatte nicht damit
> gerechnet, darum bin ich blutverschmiert… wer konnte ahnen, daß SIE so
> reagier’n… gestern Nacht ist mein IRC-Netzwerk explodiert~~~
>       (as of 2021-06-15 The MirOS Project temporarily reconvenes on OFTC)
> 


  • utilities and write... Vincent Lefevre via austin-group-l at The Open Group
    • Re: utilities ... Don Cragun via austin-group-l at The Open Group
      • Re: utilit... [email protected] via austin-group-l at The Open Group
        • Re: ut... Don Cragun via austin-group-l at The Open Group
        • Re: ut... Geoff Clare via austin-group-l at The Open Group
        • Re: ut... Robert Elz via austin-group-l at The Open Group
          • Re... Stephane Chazelas via austin-group-l at The Open Group
          • Re... Geoff Clare via austin-group-l at The Open Group
            • ... Stephane Chazelas via austin-group-l at The Open Group
          • Re... Joerg Schilling via austin-group-l at The Open Group
          • Re... Robert Elz via austin-group-l at The Open Group
            • ... Stephane Chazelas via austin-group-l at The Open Group

Reply via email to