Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run the script - my_script.ksh as process with 5 long arguments

on my solaris/linux machine ( example 1 ) ,

Later I verify the process by

 ps -ef | grep  my_script.ksh 

I don't understand way I not get the all arguments from ps -ef ? , ( see example 2 )

or maybe ps command have limitation to display a long line ? , or maybe need to write the ps command with some flags that will enable to display all arguments ?

what need to do in order see all arguments from ps -ef command ?

Example 1 ( run my_script.ksh with the relevant arguments )

           #  ( /tmp/my_script.ksh PATH1=/usr/lib/efcode/sparcv9/efdaemon PATH2=/etc/opt/VO/share/conf/nnmet/mib/Fore-pre802dot1Q-VLAN-MIB.mib -scan-files -ignore-simbolic-links -give-full-file-details ) &
 [1]     18942

Example 2 ( verify script proccess , but can't see all arguments ? )

       # ps -ef | grep my_script.ksh 
root 18942 11889   0 13:22:20 pts/1       0:00 /bin/ksh /tmp/my_script.ksh PATH1=/usr/lib/efcode/sparcv9/efdaemon PATH2=/etc/o     
share|improve this question
    
Try ps -ef without grep and try ps -ef | less -+S. –  Khaled Jan 16 '13 at 12:10
    
I get the same results with ps -ef | less -+S -:( –  yael Jan 16 '13 at 12:16
    
@Khaled - Maybe need to transfer my question to stack-overflow , –  yael Jan 16 '13 at 12:53

2 Answers 2

up vote 3 down vote accepted

On Solaris, try using /usr/ucb/ps -auxwww | grep my_script.sh instead. This will show the full command line and arguments of the process. For Linux, simply use ps aux.

Also try experimenting with forcing certain fields only to be displayed by ps, e.g. ps -ao comm,args will display the command and its arguments.

A bit of time spent in man ps should get you on the right track.

share|improve this answer
    
GREAT ITS WORKS -:) -:) -:) thx so mutch –  yael Jan 16 '13 at 13:35
    
What the ??? Why no mentioning of the Solaris pargs command. The other answer below should be the accepted one. –  unixhacker2010 Jul 24 '13 at 23:09

/usr/ucb/ps is being deprecated and no more installed by default in current Solaris releases.

ps -ao comm,args will suffer the same issue, i.e. command line truncated to 80 characters by design.

Here is a supported alternative solution:

pargs $(pgrep my_script.sh)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.