i wrote a small bash script to do a mass search/replace using 2 files...
$DESC is the file with the labels to put in the destination file
$XML is the destination file (the file with the entries that need to be replaced therein)
i have it echoing the regex line to stdout for diagnostic purposes and it looks like this on the first item:
if i take the 's/<description> and prepend a perl -p -i -e on the ordinary shell, it works fine, but it doesnt work from within the script...
# Grab all the descriptions, count them, then correspond fo the second file #
for i in `seq 1 1`;
NR=`expr $NR + 1`
sed -n "$NR"p $XML | grep "<description>" > /dev/null
COUNTER=`expr $COUNTER + 1`
NEWDESC=`sed -n "$COUNTER"p "$DESC"`
echo "toreplace1: $TOREPLACE1"
echo "newdesc: $NEWDESC"
echo "XML: $XML"
echo "toreplaceinfal: $TOREPLACEFNL"
# read BUF1
perl -p -i -e $TOREPLACEFNL $XML