#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    3
    Rep Power
    0

    How to get the pid of a process?


    The embedded platform that I am using does not support the following commands - awk, sed, pidof, cut and find. And I want to write a shell script that sends a signal to a process. How can I get the PID of the process and send it a signal.

    The following do not work becz awk and pidof commands are not supported -
    kill -s $1 $(pidof test)
    kill -s $1 $(ps auxw | grep test | grep -v grep | awk {print $1})

    Is there another way to get the pid of a process.

    Thanks,
    Ruchika
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Europe
    Posts
    51
    Rep Power
    12
    Just curious - which shell do you want to use: c, bash, korn.. ? This section may be not what you need, because if you have a c-shell, it's not the same as C language in this section. --Raokramer
    Last edited by raokramer; September 19th, 2003 at 09:27 PM.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    3
    Rep Power
    0
    want to use the bash shell

    Ruchika
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Europe
    Posts
    51
    Rep Power
    12
    Then why did you post it in C/C++ section? Anyway I'll *try* to find an answer. --Raokarmer
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Europe
    Posts
    51
    Rep Power
    12
    I don't know. Go to perl section, even if your system doesn't support perl. (Does your system support perl by chance?)
    Last edited by raokramer; September 19th, 2003 at 10:11 PM.

IMN logo majestic logo threadwatch logo seochat tools logo