This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: more on Re: bash process substitution "<(list)" [spot the difference]
- From: Eric Blake <ebb9 at byu dot net>
- To: cygwin at cygwin dot com, binkley at alumni dot rice dot edu
- Date: Tue, 29 May 2007 21:42:10 -0600
- Subject: Re: more on Re: bash process substitution "<(list)" [spot the difference]
- References: <465CE9DE.4030907@alumni.rice.edu>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to B. K. Oxley (binkley) on 5/29/2007 9:05 PM:
> Why does one of these scripts produce an error and the other does not?
> function f()
> {
> echo "$1"
shell builtin, and it does not touch the fifo (try replacing this with
/bin/echo to see the difference)
> cat "$1"
so the fifo is still available
> function f()
> {
> ls -l "$1"
external process, which calls exit() and thus closes the only read handle
on the fifo. At which point, the writer is closed since no reader exists.
> cat "$1"
the fifo no longer exists, so the error is correct
If you need the fifo to persist over several external commands, you need
to use a shell grouping construct or an exec so that the shell holds a
handle to the fifo for the duration of the shell function. And this is
not cygwin specific.
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGXPKR84KuGfSFAYARAlZuAKDVNUr7vzs2lRFjcaS0201C+uu7IgCfUK81
vVzTHO2X4g0SKg2CBK126hk=
=UL94
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/