This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
fd handle bug
- To: "gnu-win32 at cygnus dot com" <gnu-win32 at cygnus dot com>, "cgf at bbc dot com" <cgf at bbc dot com>
- Subject: fd handle bug
- From: Erwin Achermann <acherman at inf dot ethz dot ch>
- Date: Wed, 01 Apr 1998 13:34:40 +0100
- CC: Sergey Okhapkin <sos at buggy dot prospect dot com dot ru>, Geoffrey Noer <noer at cygnus dot com>
- Organization: ETH Zuerich
- Reply-To: erwin dot achermann at switzerland dot org
Howdy all,
while porting a unix shell script suite, i came across an fd handler bug
A workarround is sufficiently easy, but nevertheless someone might be
able to fix it. It might be related to the readlink() bug, another file
descriptor bug reported recently here on the list by Wolfgang Guelcker
<wgue@berlin.snafu.de>. A bad feeling creeps up my back when i think of
all the inexplicable errors that may stem from one single fd bug!
Here is the reduced script that works as expected on unix but on cygnus
B19 it gives that (un-)funny /dev/fd/6 error
I am running Chris Faylors patched version of cygwinb19.dll.
Keep on digging!
Erwin
-----------------------------------------
#!/bin/bash
e="end"
b="begin"
f=myfile
f=myfile
echo "some real data" > $f
#echo "$b" >> $f
#echo "some old data" >> $f
#echo "$e" >> $f
tmp=$f.tmp
echo "$b" > $tmp
echo "some tmp data" >> $tmp
echo "$e" >> $tmp
# this works on unix as expected
#cat $f <(grep -q "$e" <$f || echo "\n$b\n$e") | \
# sed -e "/$e/ r $tmp" -e "/$b/,/$e/ d" > $f.new
# ---> leads to: $ cat: /dev/fd/6: No such file or directory
#workarround for cygnus
(grep -q "$e" <$f || echo "\n$b\n$e") | cat $f - | \
sed -e "/$e/ r $tmp" -e "/$b/,/$e/ d" > $f.new
--
Erwin Achermann Tel: ++41 1 632 74 40
Institut fuer Wissenschaftliches Rechnen Fax: ++41 1 632 11 72
ETH Zentrum, IFW C29.2 mailto:achermann@inf.ethz.ch ICQ:4625051
CH-8092 Zuerich http://www.inf.ethz.ch/personal/acherman/
> Perfection is reached, not when there is no longer anything to add, <
> but when there is no longer anything to take away. <
> -- Antoine de Saint-Exupery <
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".