–Need to get the status of the background running script.
Initially, I ran the script and terminated it turned to stat “T”
further, running the same script but while grep getting the script with stat “T”and “R”
Here, how to get the process with only “R”. here is the command used
ps aux | grep test.sh | grep -v grep
Advertisement
Answer
Using awk :
ps aux | awk '$7 == "R+"'