On 2021-06-29 17:28:40 +0100, Stephane Chazelas via austin-group-l at The Open 
Group wrote:
> 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.

I would say that when a process is killed by a signal, it is not
a behavior of this process: it is not the process that chooses to
terminate.

-- 
Vincent Lefèvre <[email protected]> - 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