ash >& bug? [was: Re: svn commit: trunk/uClibc/test]
Bernhard Reutner-Fischer
rep.dot.nop at gmail.com
Thu Oct 2 14:25:45 UTC 2008
On Thu, Oct 02, 2008 at 03:58:18PM +0200, Hans-Christian Egtvedt wrote:
>On Thu, 2 Oct 2008 15:34:19 +0200
>Hans-Christian Egtvedt <hans-christian.egtvedt at atmel.com> wrote:
>
>> On Thu, 2 Oct 2008 05:54:44 -0700 (PDT)
>> egtvedt at uclibc.org wrote:
>
><snipp>
>
>> > Use more generic redirecting of output in the test suite
>> >
>> > This patch replaces the "&> file" with "> file 2>> file". The latter
>> > is compatible with Busybox ash shell, which makes it easier to run
>> > the test suite on target.
>> >
>>
>> Hmmm, patch is wrong, stderr is not added to output file.
>>
>> The problem still persists, could we remove the bash specific usage of
>> io redirection?
>>
>> Test case:
>> ~ > (echo out1; echo err >&2; echo out2) 2>&1 > foo
>> ~ > cat foo
>> out1
>> err
>> out2
>> ~ >
This one works reliably about everywhere:
$ (echo "out1" ; echo "err" >&2 ; echo "out2") > foo 2>&1
but ash rejects this:
$ (echo "out1" ; echo "err" >&2 ; echo "out2") 2>&1 >& foo
ash: syntax error: Bad fd number
It tries to use 'foo' as fd, which is not really appropriate as i think
a '>&' implies stdout, does it?
More information about the busybox
mailing list