[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Stable 2.0 and popen.test on Debian Squeeze
From: |
Mark H Weaver |
Subject: |
Re: Stable 2.0 and popen.test on Debian Squeeze |
Date: |
Tue, 01 Mar 2011 14:40:02 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Andy Wingo <address@hidden> writes:
> The difference seems to be the difference between:
>
> dash -c 'exec 1>/dev/null; echo closed 1>&2; exec 2>/dev/null; read'
>
> and
>
> bash -c 'exec 1>/dev/null; echo closed 1>&2; exec 2>/dev/null; read'
>
> Dash prints "closed" and exits immediately with error code 2. Bash
> prints "closed" and waits for input from the "read".
>
> Are we relying on non-portable shell behavior here?
In dash, "read" requires at least one argument: the name of the variable
in which to put the string. You don't see the error message because
stderr has been redirected to /dev/null. In bash, the REPLY variable is
used by default. So the "read" above ought to be changed to
"read REPLY".
Best,
Mark
- Re: Stable 2.0 and popen.test on Debian Squeeze,
Mark H Weaver <=