#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Posts
    64
    Rep Power
    10

    Could not get script name running from ps -ef command ?


    hi..

    i have one perl script called sendsms.pl. After i execute the perl script as background process and run ps -ef, it did not display the filename. It was display as "/usr/bin/perl". How could execute the perl program and display the filename using ps command ?

    Code:
    #./sendsms &
    #ps -ef |grep send
    #ps -ef |grep perl
    xxxx   1234   640  2  Dec 11  /usr/bin/perl
    Thank you,
    baharin
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2006
    Posts
    2,477
    Rep Power
    1752
    It will depend upon what version of Unix you are using. A good place to start, for any version is with man ps. What is happening is that your script (presumably starting with #!/usr/bin/perl) is being read and interpreteted by perl, hence perl is the running process you see. There are options to ps that permit extra info to be shown, try:

    Code:
    ps -eo pid,user,args | grep perl
    to show the pid, the user and , hopefully, the command line plus arguments - which should be perl and your script.
    The moon on the one hand, the dawn on the other:
    The moon is my sister, the dawn is my brother.
    The moon on my left and the dawn on my right.
    My brother, good morning: my sister, good night.
    -- Hilaire Belloc

IMN logo majestic logo threadwatch logo seochat tools logo