B. K. Oxley (binkley) wrote: > I am exploring how process substitution works on Cygwin. I have scripts > which run fine on Linux but not on Windows XP. > > Why does one of these scripts produce an error and the other does not? > > Script #1: > > $ cat a > #!/bin/bash > > function f() > { > echo "$1" > cat "$1" > } > > f <(echo OK) > > $ ./a > /proc/self/fd/63 > OK > > Script #2: > > $ cat b > #!/bin/bash > > function f() > { > ls -l "$1" > cat "$1" > } > > f <(echo OK) > > $ ./b > lrwxrwxrwx 1 luser None 0 May 29 15:49 /proc/self/fd/63 -> pipe:[1728] > cat: /proc/self/fd/63: No such file or directory
With the exception of a slight bit of file name conversion, I get the same result as you do with Cygwin when I run on Linux (FC4): # /tmp/a /dev/fd/63 OK # /tmp/b lr-x------ 1 lhall lhall 64 May 29 23:26 /dev/fd/63 -> pipe:[916212] cat: /dev/fd/63: No such file or directory This is using your scripts verbatim. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _____________________________________________________________________ A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? -- 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/