Find the answer to your Linux question:
Page 2 of 2 FirstFirst 1 2
Results 11 to 13 of 13
ps -ef does return root 5887 1 0 14:15 pts/2 00:00:00 /home/progress/91c/bin/_mprshut /home/database/custom -C watchdog I am runing ps as root and the shell script as root...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #11
    Just Joined!
    Join Date
    Mar 2005
    Posts
    7

    ps -ef
    does return
    root 5887 1 0 14:15 pts/2 00:00:00 /home/progress/91c/bin/_mprshut /home/database/custom -C watchdog

    I am runing ps as root and the shell script as root

  2. #12
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    Dang! Well, it should work on the command line, so let's go thru it one line at a time...

    First
    ps -ef |grep custom

    then
    ps -ef | grep custom | awk '{print $8, $10}'

    It seems to me as though it should be working...
    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

  3. #13
    Just Joined!
    Join Date
    Mar 2005
    Posts
    7
    yes at the command line both work, but in the shell script they don't..

    Actually I just figured it out...here was the solution

    FIND_PROC=`ps -ef --columns 160 -ef |grep custom |awk '{if ($10~/watchdog/)print }'`
    echo "$FIND_PROC"

    adding the columns 160 allowed the awk to read pids longer than 80 characters.....

    Thanks for all your help

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •