[BusyBox] New applet: awk

Joerg Schmitz-Linneweber schmitz-linneweber at aston-technologie.de
Fri Sep 20 07:37:03 UTC 2002


Hi!

On Friday, 6. September 2002 11:05, Dmitry Zakharov wrote:
> Hello,
> here is my implementation of awk applet for busybox. It is very small
> (adds about 18k on i386), and has all features of posix awk plus most
> GNU extensions. It's not a port but the code written from scratch, so it
> needs thorough testing. Please try it and tell me about all found bugs
> (patches are welcome too ;)  Also I'm interesting how it works on
> non-intel platforms
I tried your awk applet and found that it seems as if it can't handle tabs 
(\t) in regexp's!

if you have a file "bar" like this:
---- snip -------------------
\tfoo
foo
---- snap -------------------
[ Where is \t is a _real_ tab character (i.e. one byte==0x09) ]

and you awk this thru gawk like this:
awk '/^\tfoo/ { print "found" }' bar
the result will be:
found

but the BB awk gives:
[nothing] :-)

I had a look through the code but I must admire that such an amount of 
indirections and special cases is quite difficult to understand (even after 
two hours ;-)
I _believe_ it must be somewhere around the skip_spaces() function where tabs 
are eaten but I don't belive that simply discarding this construct will be of 
much help as along as there is nothing in the regexp parsing which will 
handle the tabs from then on....

Perhaps its easier for you to have a quick look?
And btw. it seems as if the opposite (printing a tab after a regexp was 
found) can't be handled either.

If someone asks why does anybody need to find tabs in regexp's? The answer is 
that I would like to get awkiawki to work with busybox and as the name 
implies it makes heavy use of awk... And a basic functionality inside depends 
on searching and replacing tabs... (awkiawki is a *very* small WikiWiki 
engine and can do wonders combined with BB and boa.)

Salut and thank you,
  Joerg

-- 
Joerg Schmitz-Linneweber
gpg/pgp key id: 0x146428F1
ASTON GmbH, Ruhrorter Stra?e 9, 46049 Oberhausen, Germany
Tel. +49 (208) 6201930, FAX +49 (208) 6201950, http://www.aston-technologie.de



More information about the busybox mailing list