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

    Join Date
    Nov 2005
    Rep Power

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


    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 ?

    #./sendsms &
    #ps -ef |grep send
    #ps -ef |grep perl
    xxxx   1234   640  2  Dec 11  /usr/bin/perl
    Thank you,
  2. #2
  3. Contributing User
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2006
    Rep Power
    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:

    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