Operating System - HP-UX
1823416 Members
2770 Online
109655 Solutions
New Discussion юеВ

HP equivilant to /usr/ucb/ps auxwwe on Solaris - shows processes environment

 
Pyers Symon
Advisor

HP equivilant to /usr/ucb/ps auxwwe on Solaris - shows processes environment

The above command not only shows the command args but also shows the processes environment. For example:
/usr/ucb/ps auxwwe 28451
root 28451 0.0 0.0 328 232 pts/3 S Mar 17 0:00 -sh HOME=/ PATH=/usr/sbin:/usr/bin LOGNAME=root HZ= TZ=GB TERM=xterm SHELL=/sbin/sh

I realise it is trivial to get under HP a processes arguments (using the UNIX95= ps -eo args syntax or via PSTAT_GETCOMMANDLINE) but is there any way to show the processes' environment as well?
5 REPLIES 5
Dennis Handly
Acclaimed Contributor

Re: HP equivilant to /usr/ucb/ps auxwwe on Solaris - shows processes environment

Not that I know of. On 11.31 there is a gcore(1) command and then you can pick the info out. Or you can attach with gdb and print them.

What are you looking for? Is this a one time case?
Pyers Symon
Advisor

Re: HP equivilant to /usr/ucb/ps auxwwe on Solaris - shows processes environment

Not for me ... for our Oracle DBA so he can see the environments. Its on 11.23 btw so no gcore yet. You have basically confirmed by suspicions that it isn't possible. (unless anyone else knows different!)
Dennis Handly
Acclaimed Contributor

Re: HP equivilant to /usr/ucb/ps auxwwe on Solaris - shows processes environment

>for our Oracle DBA so he can see the environments. It's on 11.23 btw so no gcore yet. You have basically confirmed my suspicions that it isn't possible.

There is a difference between impossible and hard (not easy) to do.
See these other links about gcore and getting the environment with gdb.
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1212971
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=763461
Pyers Symon
Advisor

Re: HP equivilant to /usr/ucb/ps auxwwe on Solaris - shows processes environment

hmm .. I will look at it tomorrow. My major issue is that it would have to simple enough to use on a day-to-day basis by a non-Unix specialist.
Dennis Handly
Acclaimed Contributor

Re: HP equivilant to /usr/ucb/ps auxwwe on Solaris - shows processes environment

>My major issue is that it would have to simple enough to use on a day-to-day basis by a non-Unix specialist.

I would have thought you look at it only once to fix things and then you never need to do it again.

Once you do the gcore, you could just use "strings -a core | grep XXX".
This may be slow but it's simple.