bspkrs

silly bash script

Nov 4th, 2013
619
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.47 KB | None | 0 0
  1. # This script will take a list of member IDs in a text file and run a replacement
  2. # on those member IDs in a given data set.  Currently the script is written to
  3. # replace the member ID with the same member ID prefixed with "BC".
  4. cat Set_2_members_not_in_1.txt | while read line; do
  5.     echo Processing member $line...
  6.     for fl in `ls ./1500_initial_2_All/*.*`; do
  7.         mv $fl $fl.bak
  8.         sed "s/$line/BC$line/g" $fl.bak > $fl
  9.         rm -f $fl.bak
  10.     done
  11. done
Advertisement
Add Comment
Please, Sign In to add comment