F . Brasburg F . Brasburg - 2 years ago 181
Bash Question

Set process name in shell

I have something like this

./myProcess.sh &

So I run it in background. When I put ps the proccess name is "bash".

16282 pts/5 00:00:00 bash

Is there any way of starting a process with a name? When I put the command ps, I wanna see the proccess name (and the PID, and other information), not "bash".

Thank you so much

Answer Source

The script name is in bash's command-line, it's just ps doesn't display it by default. You can use ps -f to print the full argument list.

$ ps -f
jkugelm+  28798   9819  0 16:17 pts/0    00:00:00 /bin/bash ./myProcess.sh
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download