Path: utzoo!attcan!uunet!mcvax!hp4nl!phigate!nlgvax!hans From: hans@nlgvax.UUCP (Hans Zuidam) Newsgroups: comp.sys.amiga Subject: Re: More wishes: how about a port of awk? Summary: Get ARexx Keywords: shell programming Message-ID: <261@nlgvax.UUCP> Date: 25 Jun 89 21:26:38 GMT References: <1879@leah.Albany.Edu> <41884@bbn.COM> <41912@bbn.COM> Reply-To: hans@nlgvax.UUCP (Hans Zuidam) Followup-To: comp.sys.amiga Organization: Philips Research Geldrop Lines: 87 Expires: Sender: 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