logging command parameters

logging command parameters

Post by Paul Bob » Fri, 27 Sep 1996 04:00:00



Is there a facility for unix administration that will log all parameters given
to any unix program/command or shell?

Doing a "ps" displays the program being run, and a who displays some of the
parameters, and turning on accounting only records the command typed.

If I prefixed every command executed by "sh" then I'd have "sh" recorded for
my entire session.... an effective way to cover my command usage.

However unless I'm mistaken there is no "built-in" facility for recording the
parameters to any command.... unless there is a third part utility for doing
so.

Does anything exist to do this?

 
 
 

logging command parameters

Post by Randy M. Haym » Fri, 27 Sep 1996 04:00:00


|>Is there a facility for unix administration that will log all parameters given
|>to any unix program/command or shell?
|>
|>Doing a "ps" displays the program being run, and a who displays some of the
|>parameters, and turning on accounting only records the command typed.
|>
|>If I prefixed every command executed by "sh" then I'd have "sh" recorded for
|>my entire session.... an effective way to cover my command usage.
|>
|>However unless I'm mistaken there is no "built-in" facility for recording the
|>parameters to any command.... unless there is a third part utility for doing
|>so.
|>
|>Does anything exist to do this?
|>
|>
|>

In the Unices derived from the Mach kernel, or otherwise having the table(2)
structures of system tables, there may exist just what you are looking for
in the process argument buffer TBL_ARGUMENTS.

I wrote a utility for Digital UNIX (proc_info), and I modified the popular
syd utility to get this type of data.  Anonymous ftp or point your browser
at:

ftp://raven.alaska.edu/pub/randy/perf_mon_tools/syd-3.2.tar.gz
ftp://raven.alaska.edu/pub/randy/proc_info_utils/proc_info-1.0.tar.gz

--

        "Ethernet works in practice but not in theory" -- Bob Metcalfe

 
 
 

logging command parameters

Post by Patrice Alla » Sat, 28 Sep 1996 04:00:00



>Is there a facility for unix administration that will log all parameters given
>to any unix program/command or shell?
>Doing a "ps" displays the program being run, and a who displays some of the
>parameters, and turning on accounting only records the command typed.
>If I prefixed every command executed by "sh" then I'd have "sh" recorded for
>my entire session.... an effective way to cover my command usage.
>However unless I'm mistaken there is no "built-in" facility for recording the
>parameters to any command.... unless there is a third part utility for doing
>so.

I don't understand what you'd like to do but maybe the following will help you
achieve it in a ksh environment (at list it works on my AIX machine 3.2.5 /
4.1.4 ) :

ps aeww
script
set -x
HISTSIZE variable & ~/.sh_history file

Hope this helps,
Patrice.

---------------------------------------------------------------------

|  #include <disclaimer.h>  |   V-mail : (+33) 92 29 39 49 + 3902   |
|-------------------------------------------------------------------|

 
 
 

1. passing parameter to shell function as in the normal unix commands (not positional parameter)

Hi,

I have a function defined in in .profile which accepts three
parameters.

function myfn
{
var1=$1
var1=$3
var1=$3

I am wondering, whether the function can be invkoded as

"myfun -c var1 -d var2 -e var3"

The reason, I would prefer this method, because I don't have to know
the order of the parameters and optionally I can ignore one or more of
the parameter and set the default value, inside the program if needed.

note: I know, it can be invoked as "myfun var1 var2 var3"
      I am using ksh under AIX 5.2

Thanks,
Prince.

2. resending mail

3. diald, chat log error 'Can't get terminal parameters: Invalid argument'

4. DAT Transfer

5. iptables LOG parameters

6. PLEASE! URGENT! MAILPROBLEM

7. log sense parameter code does not make sense

8. partition table lost

9. Meaning of %T parameter in Apache Log

10. Logging parameters of POST methods in Apache?

11. How do I test whether commands do support certain parameters?

12. USB command line parameters

13. GDB and command line parameters?