Current menu script

Joe Chasan joe at magnatechonline.com
Wed Feb 1 14:43:42 PST 2006


On Wed, Feb 01, 2006 at 02:19:33PM -0800, Jeff Harrison wrote:
> One of my clients has asked me to log all attempted
> access via menu items to all of their files.  So I
> created a file called accesslog and a library process
> to post to it that looks like the following:
> 
> @menu:::
> ::lookup acc = accesslog r=free -e:
> ::acc(1)=@id     ' who:
> ::acc(2)=@td     ' date (when):
> ::acc(3)=@tm     ' time (when):
> ::acc(4)=@pm     ' menu path passed in @pm (what):
> ::acc(5)=""      ' ??  name of menu script (what):
> ::write acc:
> fini:::
> ::exit:
> 
> The problem I am running into is on the post to
> acc(5).   I would like to post the name of the menu
> script being run.  I tried testing by running a
> regular shell script that calls the following command
> line:
> 
> /appl/fp/dclerk lib -s1 -z logger -r 1E2
> 
> I was hoping that getenv("0") would return the name of
> the script, but it doesn't.  It just returns "".
> 
> I also tried @argv("0") and @argv("1") but no luck
> there either.
> 
> Do I need to do a user command?  I guess I need the
> process name of the parent process.  Any help would be
> appreciated.  Thanks.

if you are looking for the command line itself, how about  @CMDLINE[]
it is an array.
@CMDLINE["0"] tells you how many elments in it.
i don't think there is any harm referencing unused elements, though,
say if you wanted to do acc(5)=@cmdline["1"]<@cmdline["2"]<@cmdline["3"]...
 
--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---
-Joe Chasan-                      Magnatech Business Systems, Inc.
joe at magnatechonline.com           Hicksville, NY - USA
http://www.MagnatechOnline.com    Tel.(516) 931-4444/Fax.(516) 931-1264


More information about the Filepro-list mailing list