retitle 990265 mksh: output error is not checked for some builtins
reopen 990265
thanks

On 2021-06-24 16:26:24 +0200, Vincent Lefevre wrote:
> Anyway, this was just an example. So, instead of a closed stdout,
> let's write to a full file system:
> 
> $ pwd > /dev/full
> $ echo $?
> 0
> $ /bin/pwd > /dev/full
> /bin/pwd: write error: No space left on device
> $ echo $?
> 1

Another example (due to the "sleep 1", the "true" has normally
terminated when pwd is executed):

$ { trap '' PIPE; sleep 1; pwd; echo $? >&2; } | true
0

both with mksh and ksh93.

With dash:

$ { trap '' PIPE; sleep 1; pwd; echo $? >&2; } | true
sh: 1: pwd: pwd: I/O error
1

-- 
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