Re: UNIX95 (190 Views)
Reply
Super Advisor
Shivkumar
Posts: 1,207
Registered: ‎05-22-2005
Message 1 of 7 (190 Views)
Accepted Solution

UNIX95

Dear Sirs,

What is the significance of UNIX95 while greping process ?

Thanks,
Shiv
Please use plain text.
Honored Contributor
Indira Aramandla
Posts: 1,313
Registered: ‎06-21-2001
Message 2 of 7 (190 Views)

Re: UNIX95

Hi Siv,

UNIX95 is a variable or is a one line method to set a variable temporarily. UNIX95 variable is used to enable special features such as a hierarchical listing of parent or child programs, or to search for a program WITHOUT grep using ps
see man ps

IA
Never give up, Keep Trying
Please use plain text.
Honored Contributor
Muthukumar_5
Posts: 4,030
Registered: ‎06-09-2004
Message 3 of 7 (190 Views)

Re: UNIX95

UNIX95 variable is used to use XPG4 namespace on greping process. Several options like -o are using with UNIX95 only.

UNIX95= ps -o pid,ppid
UNIX95= ps -A

-o option is giving several formats.

hth.
Easy to suggest when don't know about the problem!
Please use plain text.
Honored Contributor
Yogeeraj_1
Posts: 4,613
Registered: ‎11-25-2001
Message 4 of 7 (190 Views)

Re: UNIX95

hi,

see also: http://docsrv.sco.com/DIFFS/UNIX95_Conformance.html
and
http://docs.hp.com/en/5965-4406/ch05s14.html

hope this helps!

regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Please use plain text.
Trusted Contributor
Amit Agarwal_1
Posts: 153
Registered: ‎06-02-2004
Message 5 of 7 (190 Views)

Re: UNIX95

As you know, all the UNIX flavors have to obey the XPG4 standard, since they claim compliance with it. Sometimes it happens that the behavior of any command (say grep)as said by XPG4 is quite different from what it provides by default. Now to comply with standard, what these commands do is to provide the XPG4 behavior only if UNIX95 is set, else they provide their original behavior.

Sometimes, altogether they provide a new option only under UNIX95. This too is done to comply with XPG4.

-Amit
Please use plain text.
Honored Contributor
Bill Hassell
Posts: 14,205
Registered: ‎05-29-2000
Message 6 of 7 (190 Views)

Re: UNIX95

AS mentioned, UNIX95 enables different behavior in certain commands, but also in certain system calls. For the ps command, the manpage shows several options that do not work without UNIX95 being set, specifically -o -H -C -A -G -U, of which the -o -H and -C options are the most useful. UNIX95 as a variable does not have any requirements, it just has to be defined so you may see UNIX95=1 or simply UNIX95=, both formats will define the variable.

You will most often see the assignment in front of a command such as:

UNIX95= ps -efH

and for POSIX shells, this is a temporary assignment that lasts only for the duration of the command (ps). While it is tempting to simply export UNIX95, DON'T DO IT! UNIX95 affects a lot of other commands and also library calls. Setting UNIX95 globally for your session may cause some programs to work differently. Since there is no index to the affected commands and calls, only set UNIX95 when you need it.

For ps, you can always set it without problems and gain the new options. The simplest way is to create an alias in .profile:

alias ps="UNIX95= /usr/bin/ps"

And now when you login, typing: ps -efH
will work just fine. Be sure to check out the -C option to eliminate grep from ps commands.
Please use plain text.
Respected Contributor
generic_1
Posts: 533
Registered: ‎10-09-2002
Message 7 of 7 (190 Views)

Re: UNIX95

It allows you to easily sort out which proccess are taking up the most memory which can be very helpfull in tracing memory leaks and resource issues.
This is what I have found it most useful for.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation