1832676 Members
2842 Online
110043 Solutions
New Discussion

export UNIX95=XPG4 ???

 
ericfjchen
Regular Advisor

export UNIX95=XPG4 ???

In HP-UX, what does "export UNIX95=XPG4" mean?
Pls kindly explain it?

Thanks

Eric
4 REPLIES 4
Michael Tully
Honored Contributor

Re: export UNIX95=XPG4 ???


UNIX95=Unix 95 conformance
XPG4=X/Open's Portability Guide Issue 4

Have a look here:
http://ou800doc.caldera.com/en/DIFFS/UNIX95_Conformance.html

One of the best examples of this is utilising the 'ps' command differently.
Anyone for a Mutiny ?
Indira Aramandla
Honored Contributor

Re: export UNIX95=XPG4 ???

Hi Eric,

XPG (X/Open POSIX GROUP). There is an XPG2,XPG3,XPG4 - all standards to make the various flavor of UNIX.

A UNIX95 branded product is built from a number of components and includes XPG4 system calls, POSIX callable interfaces, and the ISO C library among other things. HP-UX 10.20 and later are UNIX95 branded.

The UNIX95 variable (when set) simply alters the way the 'ps' command functions. Setting the environmental variable is an alternate set of options and formatting. Its setting specifies the XPG4 behavior for this command. When UNIX95 is defined and exported XPG4 behavior is requested. This alters and augments the output and features of some commands.

In the case of ps among other things it adds the -o format option.

Look at the man pages for more details.

Indira A
Never give up, Keep Trying
Sridhar Bhaskarla
Honored Contributor

Re: export UNIX95=XPG4 ???

Hi Eric,

XPG (X/Open Posix Group) is a group that is responsible for setting standards trying to unify different flavors of UNIX atleast from a user's perspective. XPG4 is one of the versions of the standards. When the environment is set, the commands/tools will behave with XPG4 standard providing more (better) outputs. One of the commands that is frequently used is 'ps'. For ex., following XPG4 behaviour of ps can eliminate the headaches presented by 'grep'

UNIX95= ps -e -C "my_process"

In 'man ps' you will see commands available for XPG4 environment only.

For history on UNIX, refer to the following URL

http://www.unix.org/what_is_unix.html

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Bill Hassell
Honored Contributor

Re: export UNIX95=XPG4 ???

Please do NOT exort UNIX95 unless you understand the ramifications. UNIX95 is tested not only by the ps command but by some libraries that are used in many commands and application programs! To properly understand UNIX95, you'll have to scan *all* the man pages for all the libraries and commands plus research all your application programs to see if they test for UNIX95.

In other words, don't export it. Instead, use it for a specific command such as ps. When you define UNIX95 on the command line, the process 'sees' the variable and enables the changes defined in the man page for ps, but the variable disappears after the command is finished:

ps -efH
UNIX95= ps -efH

In the first example, ps produces an error (-H is not defined), but the second form temporarily defines UNIX95 and now -H is a valid option (to show program hierarchies). UNIX95= and UNIX95=XPG4 (or any other value) is all that is needed. UNIX95= defines the variable with a null value, but the XPG4 rules don't care about the value given to UNIX95, just the existence of the variable.


Bill Hassell, sysadmin