In a bash script I have to find the running time of a proccess, I do it with this command:
PROCCESS_TIME=$(ps -eo pid,etimes | grep $(ps -ef | grep SCREEN | grep PROCCESS | head -1 | awk '{print $2}') | awk '{print $2}')
Which gives me running time in seconds,then I need to convert it to minutes
PROCCESS_TIME_MIN=$(( $PROCCESS_TIME / 60 ))
It works most of the time but sometimes give me this error and script exits
0 / 60 : syntax error in expression (error token is "0 / 60 ")
or:
1893 / 60 : syntax error in expression (error token is "1893 / 60 ")
Where is my problem, How to solve it?