Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-19-2012
Registered User
 
Join Date: Jun 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
PS Command in shell script

Hi all,
Am facing issue in using ps -auxww command inside my shell script.
Please find the eeror which I got when executing my script,
"ps: unknown user xww"

NOTE : The same command was working when I execute outside the script.
Sponsored Links
    #2  
Old 06-19-2012
jayan_jay's Avatar
Forum Advisor
 
Join Date: Jul 2008
Posts: 831
Thanks: 9
Thanked 185 Times in 176 Posts
In solaris, ps -auxww will be treated as userid.
In my machine,

Code:
$ uname -sr
SunOS 5.9
$ ps -auxww
ps: unknown user xww
$ ps -auroot
   PID TTY      TIME CMD
 17306 pts/19   0:00 gzgrep
 13727 pts/9    0:00 bash


Code:
NAME
     ps - report process status
     -a    Lists information about all processes most  frequently
           requested:   all  those  except  session  leaders  and
           processes not associated with a terminal.
     -u uidlist
           Lists only process data whose effective user ID number
           or login name is given in uidlist. In the listing, the
           numerical user ID will be printed unless you give  the
           -f option, which prints the login name.

What OS you are using and i am not sure, how that command works for you when executing in command prompt.
Sponsored Links
    #3  
Old 06-19-2012
gary_w's Avatar
Registered User
 
Join Date: Oct 2010
Posts: 446
Thanks: 31
Thanked 96 Times in 88 Posts
Perhaps you need a space:

Code:
ps -a uxww

    #4  
Old 06-19-2012
ctsgnb ctsgnb is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Location: France
Posts: 2,763
Thanks: 72
Thanked 587 Times in 561 Posts
On which OS are you ?

If on SunOS, make sure the "ps" used is the one in /usr/ucb/ps
Sponsored Links
    #5  
Old 06-19-2012
methyl methyl is offline Forum Staff  
Moderator
 
Join Date: Mar 2008
Posts: 6,388
Thanks: 286
Thanked 668 Times in 640 Posts
Further to ctsgnb.
Check the ouput of type ps in both environments to make sure that they are the same.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
When i am trying to execute export command within a shell script it is saying command not found. dchoudhury Shell Programming and Scripting 4 06-18-2012 01:13 AM
Shell script running command in different shell gr8_usk Shell Programming and Scripting 9 05-23-2011 06:30 PM
help with shell script: cp command not working, but mv command works... udelalv Shell Programming and Scripting 1 04-12-2011 04:34 AM
can anyone help with shell script command about searching word with grep command? aintour Shell Programming and Scripting 2 10-14-2009 04:51 PM
Need to Write Shell Script based off of this shell command Rally_Point Shell Programming and Scripting 3 06-10-2009 05:19 PM



All times are GMT -4. The time now is 04:20 PM.