Albert E. Whale, CISSP writes:
> Guillaume Marcais wrote:

>> Isn't it a move to behave accordingly to some POSIX standard?
>> Which is probably out of the scope of Mandrake...
>> Just a guess, Guillaume.

POSIX and UNIX standards all agree that "ps -ax" is
not valid. You may use "ps -e" for the (apparently)
desired effect on any POSIX-conforming system.

Fortunately, Linux ps will interpret "ps ax" as
a BSDism. AIX and Tru64 also do this, but they
won't guess you meant "ps ax" if you use "ps -ax"
by mistake. You'd be completely out of luck on
systems running a normal UNIX.

It's like this:

"ps ax" works on Linux, AIX, Tru64, and *BSD

"ps -ax" works on *BSD only

"ps -e" works on all UNIX and POSIX systems
including NT, Linux, HP-UX, IRIX, UnixWare,
OpenServer, OS/390 OpenEdition, AIX, Tru64,
OpenUnix, Sinix, CX/UX, PowerMAXX, DYNIX/pts...

I'm leaving out Solaris, because it has both a
pure UNIX ps in /bin and a BSD one in /usr/ucb.
Normally the UNIX ps is used.

But wait! On a Linux box, you can do this:

PS_PERSONALITY=bsd
export PS_PERSONALITY

(or for a csh user, "setenv PS_PERSONALITY bsd"
might do the trick... but csh is defective anyway)

> For anyone that writes scripts, this functionality destroys
> anyone's credibility as all of the ps processing commands
> now depict the following message:

The change is particularly important for script writers!

Consider what ps is REQUIRED to do if you run "ps -aux"
on a system with a user named "x". According to the POSIX
and UNIX standards, that command asks that ps print:

1. all processes with a TTY, except session leaders
2. all processes belonging to user "x"

If the Linux ps sees that user "x" doesn't exist, then
it throws away the "-" and reparses the command line.
The second time around, "ps aux" parses correctly.

Now suppose your script gets out into the wild or ends
up being an important part of some business. Somebody
creates a user called "x". Ouch! Thus the warning.

Recent procps releases direct you to the FAQ.
You can also read the man page. Usage examples
are included.



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to