Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: <(...), >(...) and fds above 9



2019-07-02 09:59:36 +0100, Peter Stephenson:
[...]
> This fixes this up --- I think for file descriptors known to and hence
> managed by the user the behaviour of silently closing is probably
> uncontroversially unhelpful.
[...]

Thanks.

Note that ksh93 marks the fds above 2 that are open with
exec (exec 7< file or exec {fd}< file) with close-on-exec
(independently of whether the exec is done in background or
not)

Neither ksh93 nor bash close the fds opened with
{ cat <(ls -l /proc/self/fd; } {fd}< file
(that syntax doesn't work in zsh as already reported).

Note another related problem that had also been reported earlier
shared with bash but not ksh93: the fd is not closed after the
command returned when the redirection is done on a builtin,
function or compound command.

$ zsh -c 'eval "echo \$fd" {fd}< a; ls -l /proc/self/fd/$fd'
12
lr-x------ 1 chazelas chazelas 64 Jul  2 13:14 /proc/self/fd/12 -> /home/chazelas/a

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author