Is there a script or a way in linux that when I try to execute a shell script/process, if the same is running, it will prompt that same is running and will exit otherwise it will continue.
Shell – Check for Process if Same is Running
processscriptingshell-script
Best Answer
You can use this one liner to do what you want:
Example
Say I had this script:
If we use our one liner:
We run it again:
Waiting 10 seconds and running it again, it again works: