Skip to content
Advertisement

Pidof not finding the process

I want to find out a shell script process ID using pidof or ps command or any.

All i want is only the process id of it. I have used ‘pidof -x test.sh’. Which is not working. Note: I don’t want to invoke the /bin/sh or /bin/bash – because the script will not work. If i invoke /bin/sh in script, pidof is working.

Please help

Advertisement

Answer

pgrep -f script is giving the expected result. Thanks

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement