Created
September 27, 2011 10:12
-
-
Save eamonnmag/1244756 to your computer and use it in GitHub Desktop.
Script to do mass string replacement on files in a folder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OLD="http://files.ivec.org/bpa_wheat/*" | |
NEW="http://files.ivec.org/bpa/raw/agrf/*" | |
DPATH="/home/isauser/BPA-Wheat-Cultivars-3" | |
BPATH="/home/isauser/BPA-Wheat-Cultivars-3-fixed" | |
for f in `ls $DPATH` | |
do | |
FULLPATH=$DPATH"/"$f | |
echo "processing $f `date`" >>Change.log | |
sed "s/$OLD/$NEW/g" $FULLPATH > $BPATH"/"$f | |
echo "processed $ `date`" >>Change.log | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment