[comp.sys.atari.st] gnu awk questions

achowe@tiger.waterloo.edu (anthony howe) (09/18/89)

I finally tried to use the last version of << GNU AWK >> that came down
the pike to do some global text search and delete (since FOLDED 0.9e
lacks the ability to search and replace control codes).

I quickly review what I needed in the book << The AWK Programming
Language >> and tried the following:

	{ gsub( /_\b/, "" ); print }

This was meant to globally search and delete all undersorce-backspace
combinations (I'm stripping a formatted file of cude underlining and
other code that mess up my printer).

However AWK keeps giving me an "error near line 1" and quotes just
about the whole line. What's wrong?

I don't even know the diffs between << GNU AWK >> and the implementation
described in the above book. There was no documentation. All I remember
was a comment or a small readme that said I should get a copy of my UNIX
version's man page. Was there any docs with << GNU AWK >> and if so are
not my rights to it being abused by not providing it (as mentioned in 
every GNU COPYING & LICENSE notice)?

- Ant
  achowe@tiger.waterloo.edu     | "Life is not fair. Anyone who tells
   _     -|-|_   _              |  you different is trying to sell you
  (_\ |\| | | | (_) |\| \/      |  something." - The Princess Bride
                     ___/       |                        disclaimer...

close@cacilj.UUCP (Diane Barlow Close) (09/18/89)

In article <16459@watdragon.waterloo.edu> achowe@tiger.waterloo.edu (anthony howe) writes:
>I finally tried to use the last version of << GNU AWK >> that came down
>
>	{ gsub( /_\b/, "" ); print }
>
>However AWK keeps giving me an "error near line 1" and quotes just
>about the whole line. What's wrong?

As the person who wrote the GNU awk documentation, perhaps I can help.  GNU
awk was developed to run on much larger machines than ST's and was ported
to the ST by non-GNU persons.  While this is perfectly acceptable (given
the GNU copyleft info), it DOES NOT IMPLY complete compatibility with the
Unix version of GNU awk.

Several people in my local Atari club also tried to use GNU awk on the ST
and ran into the problem you describe.  They found that if they stripped
out ALL the spaces on the command line, awk worked just fine.  This is a
changed made by the person(s) who ported GNU awk to the ST.  Why they made
such a change is beyond me; perhaps they don't even know the change is
there?

The documentation for GNU awk was developed separately from the code, and
is distributed separately.  The manual is very complete and has an
excellent (if I don't say so myself :-) beginner's section.  Some of the
documentation will only apply to larger machines; ST user's will have to
rewrite the manual to fit ST GNU awk's specifics (making it freely
distributable, of course).

I hope this helps.  You can ftp GNU awk documentation from prep, as is
usual with all GNU-made products.
-- 
Diane Barlow Close
      {uunet, crash, ucsd}!cacilj!close
      close@cacilj.uucp
      Free Canada -- Trade Mulroney

mj@myrias.com (Michal Jaegermann) (09/21/89)

From article <1228@cacilj.UUCP>, by close@cacilj.UUCP (Diane Barlow Close):
> I hope this helps.  You can ftp GNU awk documentation from prep, as is
> usual with all GNU-made products.
>

All awk users on ST should also be aware that mentioned above
documentation describes a current version of gawk, which behaves like
nawk (more or less), i.e new version of awk described in a book 
"The AWK Programming Language" by AWK - Aho, Weinberger, Kernighan.
A version ported to ST is an older one, it apparently suffers from
some bugs in an original code and follows "classic" awk, now partially
obsolete.  It looks like that one should get back to the drawing 
board...


	Michal Jaegermann
	Myrias Research Corporation
	Edmonton, Alberta, CANADA
	mj@myrias.COM
	...{uunet,alberta}!myrias!mj