Determine which number out of a list is being processed at the moment


/ Published in: Bash
Save to your folder(s)

Useful if you have a shell script running lots of the same command and want to know how many of them have been done


Copy this code and paste it in your HTML
  1. Note that this works for a shell script that runs a perl script with a parameter (see related tip)
  2.  
  3. 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
  4. 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)
  5.  
  6.  
  7. ps -ef |grep batch_name |awk '{print "grep -n " $10 " param_file"}'|sh

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.