bspkrs icon

silly bash script

bspkrs | PRO | 11/04/13 03:04:12 PM UTC | 0 ⭐ | 604 👁️ | Never ⏰ | []
Bash |

470 B

|

None

|

0 👍

/

0 👎

# This script will take a list of member IDs in a text file and run a replacement
# on those member IDs in a given data set.  Currently the script is written to 
# replace the member ID with the same member ID prefixed with "BC".
cat Set_2_members_not_in_1.txt | while read line; do
    echo Processing member $line...
    for fl in `ls ./1500_initial_2_All/*.*`; do
        mv $fl $fl.bak
        sed "s/$line/BC$line/g" $fl.bak > $fl
        rm -f $fl.bak
    done
done

Comments