2021-06-29 16:28:17 +0200, Vincent Lefevre via austin-group-l at The Open Group: [...] > > ( > > sleep 1 > > set +o errexit -o xtrace > > pwd > > pwd > > ) | : > > > > Calls pwd only once with most shell implementations (all those > > where pwd is builtin). > > > > Is that allowed? > > Since POSIX doesn't require to ignore or trap SIGPIPE before executing > a builtin, I would say that it is the expected behavior with builtins. [...]
But utilities are meant to behave the same whether they're builtin or not. A non-builtin pwd writting to a closed pipe would not cause the shell to exit. That was discussed in May 2016 in the "unexported special variables vs utilities implemented as builtins" flood thread here. Not sure any conclusion was reached though. -- Stephane
