[BusyBox] awk bug

Manuel Novoa III mjn3 at codepoet.org
Tue May 11 16:39:44 UTC 2004


On Tue, May 11, 2004 at 12:32:33PM -0400, Sauder, Vernon wrote:
> > From: Dmitry Zakharov [mailto:dmit at crp.bank.gov.ua] 
> > Sent: Tuesday, May 11, 2004 5:44 AM
> > 
> > Hello,
> > 
> > >>echo baudrate=9600 | awk -F= '{ print $2; }'
> > >>
> > >>This line should print "9600" (and does on RedHat) but on busybox 
> > >>(latest cvs, post pre10) it always prints "baudrate", no 
> > matter which 
> > >>token I ask it to print -- $1, $2, $3 or $4. The -F does 
> > not seem to 
> > >>play a difference. If the input is space separated, and -F is not 
> > >>given, the same output.
> > >>
> > 
> > I suppose it's something related to architecture, maybe the 
> > problem with 
> > int<->float conversions.
> > Could you tell more about your environment?
> > 
> It has nothing to do with numeric conversions. It is a strictly text error.
> Try something like { echo "abc def" | awk '{print $2}' } -- it prints "abc".
> 
> I am running the latest busybox on a PowerPC (852T) custom board. I am using
> gcc 3.3.2 and libc 2.3.2. Has anyone tried this on a different
> architecture/environment? Does it work?

mipsel running busybox and uClibc snapshots from March 30.

# echo baudrate=9600 | awk -F= '{ print $2; }'
9600

# echo "abc def" | awk '{print $2}'
def

So looks like it is working here.

Manuel



More information about the busybox mailing list