[aklug] Re: Portability question

From: Royce Williams <royce@alaska.net>
Date: Thu May 21 2009 - 07:17:55 AKDT

bryanm@acsalaska.net wrote, on 5/20/2009 11:29 PM:
> On Wed, May 20, 2009 6:20 pm, Royce Williams wrote:
>> Christopher Howard wrote, on 5/20/2009 5:34 PM:
>>> Hi. Is the command "ps -e u" available on all *nix systems? (I.e.,
>>> POSIX-compliant systems.) And does it generate the same output as in Linux?
>>>
>>> Even if you could just speak for your personal non-Linux OS, that would
>>> be helpful.
>> Depends on how portable you need it to be. :-)
>>
>> royce@heffalump$ uname -nr
>> heffalump.prv.tycho.org 7.2-RELEASE

> Note that Christopher put a space in the middle: "ps -e u".
>
> Slackware Linux uses procps, which takes options of three
> different kinds: single, double, and no dash. I'd be surprised
> if there was much portability across different OSes.

Ah, right - Jeff pointed that out as well.

'u' as a standalone argument isn't supported.

royce@heffalump$ ps -e u
ps: Process environment requires procfs(5)
ps: illegal argument: u
usage: ps [-aCcefHhjlmrSTuvwXxZ] [-O fmt | -o fmt] [-G gid[,gid...]]
          [-M core] [-N system]
          [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]
       ps [-L]

So, Christopher - let's take another tack. What cross-platform activity are you trying to accomplish? Maybe that could help us find the right syntax.

Here's the same test on Solaris 8:

royce@terminator$ uname -a
SunOS terminator 5.8 Generic_117000-05 sun4m sparc SUNW,SPARCstation-20
royce@terminator$ ps -e u
usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
        [ -u userlist ] [ -U userlist ] [ -G grouplist ]
        [ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
  'format' is one or more of:
        user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
        pri opri pcpu pmem vsz rss osz nice class time etime stime
        f s c lwp nlwp psr tty addr wchan fname comm args projid project

Royce
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu May 21 07:18:06 2009

This archive was generated by hypermail 2.1.8 : Thu May 21 2009 - 07:18:07 AKDT