Naming a background process

How do I assign a name to a background process?  For example,  I want to execute a script ./test & and I want to be able to find it using ps -ef |grep test.  Right now, if I  ./test &, a process gets assigned to it and I only see a -ksh for the name.
Who is Participating?
elfieConnect With a Mentor Commented:
With interactively started programs, the name you type will be the name for the background process.

If you don't see the process anymore, the process has terminated.

Just try putting at the end of the script a "sleep 60", and execute the ps again. You must see it
scawthonAuthor Commented:
I still only get a -ksh.  But if I use nohup <filename> I see a -sh <filename>.

When doing the ps , you also see teh 'controlling' terminal.

try executing ps -ft 'controlling terminal'
it looks like "ps -ft pts/9"
This question was awarded, but never cleared due to the JSP-500 errors of that time.  It was "stuck" against userID -1 versus the intended expert whom you awarded.  This corrects that and the expert will now receive these points, all verified.

Please click on your Member Profile, select "View Question History" to navigate through any open or locked questions you may have to update and finalize them.
Moderator @ Experts Exchange
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.