Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter out parm value on 'ps' command

Status
Not open for further replies.

trisco

MIS
Jan 3, 2001
44
US
I need help to create a script for a "ps -ef" command that will remove or blank out a sensitive parm value. I do require the -ef options in the ps cmnd. The character string required to be blanked out follows the value "AUTOSYS". Here's a sample of the output:

jdeb7333 217538 169032 0 10:00:57 - 0:51 runube AUTOSYS sensitive PD7333 R5641002 DLT001 ...etc

The sensitive value is the 10th parm and it must follow AUTOSYS to be a candidate for wiping out. The remaining info is to be displayed at the standard out. I've looked at sed and grep'ing but can't seem to get them to work successfully. Any help is appreciated.
 
Try this (untested) command

ps -ef | awk '{if ($9=="AUTOSYS") $10="***";print}' CaKiwi
 
Thanks so much CaKiwi. The awk does the trick.
 
Now put an alias on their environment...
I hope it works...
Unix was made by and for smart people.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top