Ad Widget

Collapse

Passing parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jobrien99
    Junior Member
    • Oct 2005
    • 7

    #1

    Passing parameters

    Hi all,

    I was writing a user defined agent call that sums the memory for all instances of a particular program for a particular user.

    For the comand I need to be able to pass in the username and process name as a parameter.

    I know UNIX accepts multiple parameters so I wrote:

    foo_proc_size[*,*] ps -efl | grep $1 | grep $2 | grep ? |awk '{ total += $10*4; print total}' | tail -1

    [ BTW can anyone tune this to run faster ]

    but it does not parse and I get errors.

    I could put this in a shell script and write:

    foo_proc_size[*,*] foo_proc_size $1 $2

    and I think that will work from my reading of some posts.

    However I'd like to do it all on the line without starting a shell script, is this possble...should I raise a ehancemet ticket?

    Best Regards,
    John
Working...