[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: how to get the pid of a process
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2001-04-27 9:46:20
[Download RAW message or body]

> "ps -A" is the sysv version.
> "ps axc" (no dash!) is the bsd syntax for roughly the same. 
>
note: these two variants list the processes for _all_ users ...
if you want only the current user, use these:
sysv (xpg4 standard): "ps -U `whoami`"
bsd: "ps xc"
whoops ... the "c" in the bsd syntax is not standard as well ... *grmpf*
let's try this:
sysv: "ps -U `whoami` -o pid,tty,time,args"
bsd: "ps x"
these give still different output ... the "S" is missing in the sysv
syntax, but it is unportable again (solaris: s, digital unix: state, ...).

the reply to adrian's mail:

> Rumor has it that AIX has yet-another-version.
>
doesn't surprise me much ... :(

> I'd suggest something like
> 
> case `uname` in
>         SunOS) ps -A ;;
>         ...
> 
> and then do the grep yourself;
>
this will be surely a lot of fun ... :)
i can offer help for: linux (*g*), solaris2, digital unix 4, ultrix 4 
(what!? *g*).

> this of course assumes that uname is portable in and of itself.
>		
i don't know about uname (i think, it should work), but the $OSTYPE
variable depends on the login shell and therefore should not be used.

this stuff can drive one crazy ... ß-/

greetings

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
--
Nothing is fool-proof to a sufficiently talented fool.
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic