Operating System - HP-UX
1755640 Members
3231 Online
108837 Solutions
New Discussion юеВ

Re: command in XPG4 enviroment

 
SOLVED
Go to solution
Jorge Prado T
Contributor

command in XPG4 enviroment

Hi,
As I execute the commando ps in XPG4 environment?
( -o " format" options)

S.O. HP-UX 11i.

Thanks

Jorge Prado T.
3 REPLIES 3
Sameer_Nirmal
Honored Contributor

Re: command in XPG4 enviroment

Command works like this for XPG4
#UNIX95= ps -o pid,ppid,flags,state,args

Note there is a space between UNIX95= and ps

James R. Ferguson
Acclaimed Contributor
Solution

Re: command in XPG4 enviroment

Hi Jorge

You need to set the UNIX95 environmental variable, but do this only for the duration of your command line to avoid (later) tools changing their behavior because use set and exported it to your shell. Thus, by example:

# UNIX95= ps -e -o "user,vsz,pid,ppid,args" | awk 'NR>1' | sort -rnk2

*Note* the space following the equal (=) sign and then the beginning of the command. There is *no* semicolon.

This lists the user, virtual size, pid, parental pid and commandline arguements for all processes. The first (header) is snipped off and the process list sorted in descending order of process virtual size.

Regards!

...JRF...
Sameer_Nirmal
Honored Contributor

Re: command in XPG4 enviroment

OOPS!!!! Sorry
Missed the -e attribute in the command for all system running processes.

read as

# UNIX95= ps -e -o pid,ppid,flags,state,etime,args