Search code examples
linuxshell

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


Solution

  • pgrep -f script is giving the expected result. Thanks