GNU bash, version 1.14.7(1)
I have a script is called \"abc.sh\" I have to check this from abc.sh script only... inside it I have written f
abc.sh
I create a temporary file during execution.
This is how I do it:
#!/bin/sh # check if lock file exists if [ -e /tmp/script.lock ]; then echo "script is already running" else # create a lock file touch /tmp/script.lock echo "run script..." #remove lock file rm /tmp/script.lock fi