logo       

Re: Re: ash bug: msg#00260

linux.busybox

Subject: Re: Re: ash bug

"Vladimir N. Oleynik" <dzo@xxxxxxxxxxx> writes:

> Jean,
>
> > the following small script shows a bug in 1.0.0-pre2 ash. When using
> > set -x (for debugging) and redirection of stderr, ash somehow prints
> > the debug message into the wrong file. It looks like ash does the
> > redirection too early.
> > Script:
>
> > #! /bin/sh
> > exec 2> bug.log
>
> ash ignores this bash extension.

Which part is supposed to be a bash extension? "exec" or "2>"? Try it
on the commandline:

> set -x
> echo foo > foo.log 2>&1
> set +x
+ set +x
> cat foo.log
+ echo foo
foo

The "+ echo foo" should appear on the terminal and not in foo.log.

I am pretty sure that this already worked in the original bourne
shell, at least it worked in every shell I`ve used in the last 8
years.

And:
- it works in busybox 0.60.5
- ash doesn't ignore the sequence, it simply implements it
wrong. It does the redirection before printing the debug output
in evalcommand().

regards,
Jean


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise