Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: <(...), >(...) and fds above 9
- X-seq: zsh-workers 44474
- From: Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- Subject: Re: <(...), >(...) and fds above 9
- Date: Mon, 1 Jul 2019 17:22:02 +0100
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=xI9WyLSXEyYajkkQNaJlLi0R/GG20WwNj89Xvp5inK0=; b=lMgsHWYBU84ZVYJhpH3diiWefI4hCHjYlVhl3hbcTKBW08rcQR6prOmCklh+S3xc49 0sG9kHreMjV8x5ZP86gnSSd0iV4naqOkDpcSNEhw3x5KAEPMW4Na38TGH675Q+be9CJE KDfNIjQOJFiFLMO1snwEcVUcOFVDHeT7tWSW8MV+z8wOLJwXDlJjEs8qAEgEO/pHRdvZ S8xcJxQl+UGfsqJsT3l4xlZPpc3+FjRanQ58q2YsEopn3Pisdit/P5aztKlL+4LdYexw ankxO8xwT4VHntGYhuYkoTfR439toxOJC4Q/aN86bpUxRFvoGqiD+2mgngjxMink+oQn kcqA==
- In-reply-to: <1561994908.6006.19.camel@samsung.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mail-followup-to: Peter Stephenson <p.stephenson@xxxxxxxxxxx>, zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20190701100058epcas2p25e5f8dbd14d048fe2be1d831f3cf60ab@epcas2p2.samsung.com> <20190701100001.hbegs7zyu2auckhf@chaz.gmail.com> <1561975733.6006.2.camel@samsung.com> <CAH+w=7Z+UBP-0ZvHbNzfz13a7e4AFGpQyuntEaKNENeLRDdmVQ@mail.gmail.com> <1561994908.6006.19.camel@samsung.com>
2019-07-01 16:28:28 +0100, Peter Stephenson:
[...]
> Looks like =(...) doesn't call closem() at all when
> forking, hence the difference in behaviour. So
> =(...) is the odd one out.
[...]
But is there a good reason why we should close those fds?
I had to work around it in my case (something like:
join <(sort /dev/fd/$fd) <(sort /dev/fd/$fd2)
)
Another difference is that the stdin redirection to /dev/null is
not done for the =(...) form:
$ zsh -c 'cat =(ls -l /proc/self/fd)'
total 0
lrwx------ 1 stephane stephane 64 Jul 1 17:17 0 -> /dev/pts/13
l-wx------ 1 stephane stephane 64 Jul 1 17:17 1 -> /tmp/zshiMCdiC
lrwx------ 1 stephane stephane 64 Jul 1 17:17 2 -> /dev/pts/13
lr-x------ 1 stephane stephane 64 Jul 1 17:17 3 -> /proc/818/fd
$ zsh -c 'cat <(ls -l /proc/self/fd)'
total 0
lrwx------ 1 stephane stephane 64 Jul 1 17:17 0 -> /dev/null
l-wx------ 1 stephane stephane 64 Jul 1 17:17 1 -> pipe:[2995406]
lrwx------ 1 stephane stephane 64 Jul 1 17:17 2 -> /dev/pts/13
lr-x------ 1 stephane stephane 64 Jul 1 17:17 3 -> /proc/829/fd
--
Stephane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author