[comp.sys.amiga] More wishes: how about a port of awk?

ms361@leah.Albany.Edu (Mark Steinberger) (06/23/89)

Has anyone attempted a port of awk to the amiga? It would be 
a wonderful move toward compatibility between UNIX and Amiga
scripts, opening up a host of easy ports. It should also seriously
strengthen the capablities of Amiga shell scripts.

--Mark Steinberger

page%swap@Sun.COM (Bob Page) (06/23/89)

Can't port awk, it's a licensed product from AT&T.

However, a version of awk called bawk is available on fish #92.

..bob

ehoogerbeets@rose.waterloo.edu (Edwin Hoogerbeets) (06/23/89)

In article <1879@leah.Albany.Edu> ms361@leah.Albany.Edu (Mark Steinberger) writes:
% Has anyone attempted a port of awk to the amiga? 

I have GnuAwk compiled. Unfortunately, there are a few library routines
that have to be written to get it working with Manx. (vfprintf, varargs
and such)

Also, I have to go through the 120 pages (!) of TeX'ed documentation for
it to be able to give it some testing.

It should be ready in a month or so. (no promises ;-)

(BTW - I have already ported GnuSed and sent it to Bob, so it should be
coming across the net soon -- unless he found some bugs???)

Edwin

cosell@bbn.com (Bernie Cosell) (06/23/89)

In article <1879@leah.Albany.Edu> ms361@leah.Albany.Edu (Mark Steinberger) writes:
}Has anyone attempted a port of awk to the amiga? It would be 
}a wonderful move toward compatibility between UNIX and Amiga
}scripts, opening up a host of easy ports. It should also seriously
}strengthen the capablities of Amiga shell scripts.

Well, I'm not so sure that working toward such a compatibility is all that
noble a goal, but if a better scripting language is what you're after, you
might consider ditching awk and sed and friends entirely and just switch to
awk.  Available on both the Amiga and your favorite friendly Unix, and mostly
replaces the need to have a bunch of support programs hovering around your
shell doing all the things it can't (like awk, sed, grep, tr, etc...).

  /Bernie\

cosell@bbn.com (Bernie Cosell) (06/24/89)

In article <41884@bbn.COM> cosell@BBN.COM (Bernie Cosell) writes:
}In article <1879@leah.Albany.Edu> ms361@leah.Albany.Edu (Mark Steinberger) writes:
}}Has anyone attempted a port of awk to the amiga?

} if a better scripting language is what you're after, you
}might consider ditching awk and sed and friends entirely and just switch to
}awk.

AARGH!!!   I meant "...switch to *perl*"  As a bit of further emphasis,
I might mention that I went down the same path that you were
suggesting: I am a quite wizardly Unix shell hacker... I can make sed
and awk and grep and find ...  stand up and beg if need be.  I found it
VERY awkward and difficult to do even simple things on the amiga.  I
first wanted a full Bourne-shell compatible shell for the Amiga.  Then
I realized that to get that shell to do anything I'd need a whole
potload of satellite utilities.  And then I checked out perl and in one
swoop I've got virtually ALL of the capabilities that I really need
without having to add a dozen different programs to my Amy.  I've done
a small handful of "perl utilities" now and it is all working out
pretty well!  It is not perfect, because the process-control stuff was
NOT ported, so you can't do the equivalent of the Unix stdio "system()"
call and other, similar, things.  But still it is *damn* useful.

  /Bernie\

hans@nlgvax.UUCP (Hans Zuidam) (06/26/89)

In article <41912@bbn.COM> cosell@BBN.COM (Bernie Cosell) writes:
>AARGH!!!   I meant "...switch to *perl*" ...

Buy ARexx instead (or wait for 1.4?). ARexx has the nice advantage that
I can still understand my scripts five minutes after finishing them ;-).
Notwithstanding, perl is very good on UNIX machines.

Besides, ARexx is the defacto standard for scripting on the Amiga.

+-- filler for inews :-)
| /* A simple minded browser...
|  * Usage: rx fr [command]
|  */
| 
| if ~show('l', "rexxsupport.library") then
|    call addlib("rexxsupport.library", 0, -30)
|    
| if ~show('l',"rexxarplib.library") then
|    call addlib("rexxarplib.library", 0, -30)
| 
| 
| parse arg Cmd
| 
| if Cmd = '' then Cmd  = 'Less'
| 
| CmdX = LocateProgram('ram:c/ C: DF0:bin/', Cmd)
| if CmdX = ''
| then do
|	say Cmd 'not found'
|	exit 10
| end
|
| address command
|
| Directory = pragma('d')
| 
| do forever
| 	MyFile = Getfile(100, 40, Directory, , CmdX)
| 	if MyFile = '' then leave
| 
| 	l = lastpos('/', MyFile)
| 	if l > 0 then
| 		Directory = substr(MyFile, 1, l - 1)
| 	else do
| 		l = lastpos(':', MyFile)
| 		if l > 0 then
| 			Directory = substr(MyFile, 1, l)
| 	end
| 
| 	/* If true then we have a '/' or ':' at the end of the string.
| 	 */
| 	 if l ~= length(MyFile) then
| 	 	''CmdX  MyFile
| end
| 
| exit 0
| 
| 
| /* Fulname = LocateProgram(Path, CmdName)
|  * Path is a string with directory names and CmdName is the name of the
|  * command you're trying to locate. Sorry, no spaces allowed in the directory
|  * names.
|  */
| 
| LocateProgram: procedure
| do
| 	parse arg Path, CmdName .
| 
|     NrOfEntries = words(Path)
| 	FoundCmd    = 0
| 
| 	do i = 1 to NrOfEntries
| 		Fullname= word(Path, i) || CmdName
| 		if statef(Fullname) ~= '' then return Fullname
| 	end
| 
| 	return ''
| end
+--- 
 					Hans

P.S. I once saw a perl port on comp.binaries.amiga. Check the archives.
-- 
Hans Zuidam                                    E-Mail: hans@pcg.philips.nl
Philips Telecommunications and Data Systems,   Tel: +31 40 892288
Project Centre Geldrop, Building XR
Willem Alexanderlaan 7B, 5664 AN Geldrop       The Netherlands