On 2021/06/29 13:30, L A Walsh via austin-group-l at The Open Group wrote:
On 2021/06/27 14:33, [email protected] via austin-group-l at The Open
Group wrote:
Is “pwd >/dev/full” an “unrecoverable error condition” as regards
the pwd utility?
---
No. the pwd utility has had its stdout redirected by its
parent, "the shell". Since the faulty redirection was done by parent,
is the error in the child or the parent?
----
along those lines:
/tmp pwd >& /dev/zero
-bash: /dev/zero: Permission denied
/tmp> echo $?
1
/tmp> cd ~>& /dev/zero #note the command isn't executed
-bash: /dev/zero: Permission denied
/tmp>