On 2021-06-24 11:54:40 +0200, Vincent Lefevre wrote:
> Like with ksh, output error is not checked for pwd (and maybe some
> other builtins, but echo is OK), e.g. after closing stdout.
> 
> $ exec >&-
> $ for i in echo pwd; do echo "[$i]" >&2; $i; echo $? >&2; done
> [echo]
> 1
> [pwd]
> 0

Since a closed stdout is unspecified behavior in POSIX (though there
is no reason to handle it like another error here), here's a testcase
with a full FS:

$ pwd > /dev/full
$ echo $?
0

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Reply via email to