Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 11-21-2007, 08:40 AM   #1
n1mie
Prospect
 
Join Date: Feb 2003
Location: CT
Posts: 18
Leopard and ps output

I have traditionally used 'ps -acux' to list processes. When I perform that command on Tiger, I get an output that looks something like this:

Code:
USER       PID %CPU %MEM      VSZ    RSS  TT  STAT STARTED      TIME COMMAND
chip      4771   1.7  2.0   135388   5244  p3  S+   10:37AM  19:06.88 xastir
chip      4616   0.7  6.2   133148  16280  ??  S    10:34AM   9:08.95 XDarwin
But I get dramatically different results on Leopard. First of all, if I perform 'ps -acux', I get an error:

Code:
ps: No user named 'x'
I quickly determined that if I put a username afterward it would not error and I would get output, but first I had to change the order to 'ps -acxu':

Code:
  UID   PID TTY           TIME CMD
    0     1 ??         0:38.93 launchd
    0    17 ??         0:03.54 kextd
But this doesn't have the same formatting or columns as the old command. Reading the man doesn't lead me to believe that it should be different. Definitely seems broken. Any help here?
__________________
-- Chip
n1mie is offline   Reply With Quote
Old 11-21-2007, 02:33 PM   #2
baf
MVP
 
Join Date: Jun 2007
Location: Skellefteċ, Sweden
Posts: 1,173
Check these environment variables:

Code:
The following environment variables could affect ps:
    COLUMNS             Override default display width.
    LINES               Override default display height.
    PS_PERSONALITY      Set to one of posix,old,linux,bsd,sun,digital...
    CMD_ENV             Set to one of posix,old,linux,bsd,sun,digital...
    I_WANT_A_BROKEN_PS  Force obsolete command line interpretation.
    LC_TIME             Date format.
    PS_COLORS           Not currently supported.
    PS_FORMAT           Default output format override.
    PS_SYSMAP           Default namelist (System.map) location.
    PS_SYSTEM_MAP       Default namelist (System.map) location.
    POSIXLY_CORRECT     Don't find excuses to ignore bad "features".
    UNIX95              Don't find excuses to ignore bad "features".
    _XPG                Cancel CMD_ENV=irix non-standard behavior.

In general, it is a bad idea to set these variables. The one exception
is CMD_ENV or PS_PERSONALITY, which could be set to Linux for normal
systems. Without that setting, ps follows the useless and bad parts
of the Unix98 standard.
and especially:
COMMAND_MODE which can be legacy or unix2003 see this older thread
__________________
/Bengt-Arne Fjellner IT-Administrator Luleċ university, Sweden.
Some say: "You learn as long as you live".
My way: "You live as long as you learn".
baf is offline   Reply With Quote
Old 11-21-2007, 02:48 PM   #3
n1mie
Prospect
 
Join Date: Feb 2003
Location: CT
Posts: 18
Code:
echo $COLUMNS
results in
Code:
158
Code:
echo $LINES
results in
Code:
@LINES
The rest are undefined on my system.

I found out more after I posted the original message. I upgraded my Tiger system to Leopard using the Upgrade install method. This results in the old man pages being left in tact and the new man pages being left in an unusable gzip state. There is a method that can recover this, but it is intricate (I had help). I submitted a bug report to Apple. Hopefully this will be fixed in a future update.

So 'ps' was updated, I just couldn't tell from the man page at the time.
__________________
-- Chip
n1mie is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 07:53 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.