[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fd redirection behaves strangely on OSX
From: |
George Huo |
Subject: |
fd redirection behaves strangely on OSX |
Date: |
Thu, 15 Mar 2007 13:09:14 -0400 |
User-agent: |
Mutt/1.5.6i |
- The version number of Bash.
[12:53][ghuo@baz:/tmp]$ bash --version
GNU bash, version 2.05b.0(1)-release (powerpc-apple-darwin8.0)
Copyright (C) 2002 Free Software Foundation, Inc.
- The hardware and operating system.
On a Macbook Pro running OSX 10.4:
[12:55][ghuo@baz:/tmp]$ uname -a
Darwin baz.local 8.8.2 Darwin Kernel Version 8.8.2: Thu Sep 28 20:43:26 PDT
2006; root:xnu-792.14.14.obj~1/RELEASE_I386 i386 i386
- The compiler used to compile Bash.
I'm using OSX stock bash.
- A description of the bug behaviour.
While trying to use fd redirection, I seem to run into lingering bad fds that I
need to exhaust with subsequent commands. See example below. I can't reproduce
the behaviour on a Linux machine running the same version of bash.
- A short script or `recipe' which exercises the bug and may be used to
reproduce it.
[12:51][ghuo@baz:/tmp]$ echo hello world > foo
[12:51][ghuo@baz:/tmp]$ echo hello other > bar
[12:51][ghuo@baz:/tmp]$ diff <(cat foo) <(cat bar)
[12:53][ghuo@baz:/tmp]$ cat: bar: Bad file descriptor
cat: foo: Bad file descriptor
[12:53][ghuo@baz:/tmp]$ diff <(cat foo) <(cat bar)
[12:53][ghuo@baz:/tmp]$ cat: bar: Bad file descriptor
cat: foo: Bad file descriptor
[12:53][ghuo@baz:/tmp]$ diff <(sort foo) <(sort bar)
[12:53][ghuo@baz:/tmp]$ diff <(sort foo) <(sort bar)
[12:53][ghuo@baz:/tmp]$ diff <(sort foo) <(sort bar)
[12:53][ghuo@baz:/tmp]$ diff <(sort foo) <(sort bar)
1c1
< hello world
---
> hello other
[12:53][ghuo@baz:/tmp]$
- fd redirection behaves strangely on OSX,
George Huo <=