Hi,
I have created a shell script to find, whether the process is running or not. Below is my shell script.
Code:
#!/bin/bash
result=$(ps -ef | grep -v grep | grep "applicationname" | awk '{print $2}')
if [$result == ""];
then
echo "process is not running"
else
echo "process is running"
fi
When I execute this script, while the process (applicationname) is running, I get an error message like
"line 5: [8017: command not found
process is running"
But, I can say that "8017" is my process id. I don't know, how to fix this error? Why it throws?
Thanks
-Vishnu