/ Published in: Bash
Useful if you have a shell script running lots of the same command and want to know how many of them have been done
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Note that this works for a shell script that runs a perl script with a parameter (see related tip) batch_name is the name of the perl script that is being run. This can be abbreviated to whatever will uniquely identify it in grep param_file is the name of the file that parameters are taken from. This needs to be the full name (e.g. param_file.txt) ps -ef |grep batch_name |awk '{print "grep -n " $10 " param_file"}'|sh