Operating System - HP-UX
1833861 Members
2574 Online
110063 Solutions
New Discussion

Re: What is UNIX95 in these commands?

 
SOLVED
Go to solution
Prasad Joshi
Regular Advisor

What is UNIX95 in these commands?

Hi All.

It seems stupid, but I am new to Hp-UX. You can understand.

# UNIX95=1 ps -o pid=
20136
29581

# UNIX95=1 ps -o pid
PID
20136
29584


Why variable (may or maynot be variable) UNIX95 is involned in these commands?

What does UNIX95=1 actually mean? What is that '1' for?

Thanks & regards.
Prasad
9 REPLIES 9
Arunvijai_4
Honored Contributor

Re: What is UNIX95 in these commands?

Hi Prasad,

One stop solution: http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=4177

-Arun

[Moderator edit: The above link is no longer valid.]

"A ship in the harbor is safe, but that is not what ships are built for"
Gary L. Paveza, Jr.
Trusted Contributor

Re: What is UNIX95 in these commands?

Setting UNIX95 to some value (it doesn't matter what it is) changes the behavior of the ps command to use the XPG4 environment instead of the HPUX environment. You can see all the different command line options and the XPG4 behaviors by looking at the man pages (man ps).
Steven E. Protter
Exalted Contributor

Re: What is UNIX95 in these commands?

Shalom Prasad,

Setting UNIX95 enables features of ps not available without it. The 1 activates the variable, which in turn activates the features.

The -h parameter which indents and shows process parent/child hierarchy is an example.

Don't permanently set it. UNIX95 being set makes SD/UX tools fail checksums.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pete Randall
Outstanding Contributor

Re: What is UNIX95 in these commands?

The UNIX95 construct invokes the XPG4 environment, which offers some additional options. Take a look at the man page for ps to see the additional options available with XPG4 behaviour.


Pete

Pete
Kent Ostby
Honored Contributor

Re: What is UNIX95 in these commands?

It just pulls in a few different options that you can use.

Some commands HP won't change because of the standards they have committed to or because of backwards compatability, but there are still some useful stuff that you can get from the UNIX95 version.

full command name on ps is one of those.
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Peter Godron
Honored Contributor

Re: What is UNIX95 in these commands?

Prasad,
this thread cleared it up for me.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=943707

[Moderator edit: The above link is no longer valid.]

James R. Ferguson
Acclaimed Contributor
Solution

Re: What is UNIX95 in these commands?

Hi Prasad:

UNIX95 or the XPG4 behavior influences the standard in which certain commands behave.

The idea expressed in your example is to set the behavior *only* for the duration of the command line. A shorter form is this:

# UNIX95= ps -o pid

That is, there is a space after the equal sign but nothing else before the command.

The '-o' switch of 'ps' is applicable only under UNIX95 behavior. The arguments that follow tell what is to be reported. In your example it is only the process ids of your session.

You could add the arguments of your session's processes by doing:

# UNIX95= ps -o pid= -o args=

The equal sign after the "pid" or "arg" argument of 'ps' indicates that no heading should be supplied by 'ps'. This, and more, is described in the man pages:

http://www.docs.hp.com/en/B2355-60127/ps.1.html

Do not set UNIX95 except at a commandline as noted above. You may find different behavior for commands that you don't normally expect. 'cp' is one of them.

Regards!

...JRF...

[Moderator edit: Removed the broken link. Please refer to https://support.hpe.com/]

Arunvijai_4
Honored Contributor

Re: What is UNIX95 in these commands?

Hi Prasad,

Some good links for better undertanding,

http://en.wikipedia.org/wiki/UNIX_95
http://www.unix.org/what_is_unix/single_unix_specification.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Prasad Joshi
Regular Advisor

Re: What is UNIX95 in these commands?

Thanks a lot. I got it.

Thanks again.
Prasad