Skip to content

Instantly share code, notes, and snippets.

@mdyn
Created November 7, 2012 15:08
Show Gist options
  • Save mdyn/4032141 to your computer and use it in GitHub Desktop.
Save mdyn/4032141 to your computer and use it in GitHub Desktop.
Replace old to new
#!/bin/bash
DIRW=$1
echo "path $DIRW"
find $DIRW -type f -exec sed -i 's/<departDate>/<startDate>/g' {} \;
find $DIRW -type f -exec sed -i 's/<arriveDate>/<endDate>/g' {} \;
find $DIRW -type f -exec sed -i 's/<departTime>/<startTime>/g' {} \;
find $DIRW -type f -exec sed -i 's/<arriveTime>/<endTime>/g' {} \;
find $DIRW -type f -exec sed -i 's/<departAirport>/<startCode>/g' {} \;
find $DIRW -type f -exec sed -i 's/<arriveAirport>/<endCode>/g' {} \;
find $DIRW -type f -exec sed -i 's/<departCity>/<startCity>/g' {} \;
find $DIRW -type f -exec sed -i 's/<arriveCity>/<endCity>/g' {} \;
find $DIRW -type f -exec sed -i 's/<companyFull>/<companyName>/g' {} \;
find $DIRW -type f -exec sed -i 's/<companyShort>/<companyCode>/g' {} \;
find $DIRW -type f -exec sed -i 's/<codeName>/<confirmationName>/g' {} \;
find $DIRW -type f -exec sed -i 's/<departStation>/<startCity>/g' {} \;
find $DIRW -type f -exec sed -i 's/<arriveStation>/<endCity>/g' {} \;
find $DIRW -type f -exec sed -i 's/<name>/<companyName>/g' {} \;
find $DIRW -type f -exec sed -i 's/<phone>/<companyPhone>/g' {} \;
find $DIRW -type f -exec sed -i 's/<address>/<companyAddress>/g' {} \;
find $DIRW -type f -exec sed -i 's/<checkInDate>/<startDate>/g' {} \;
find $DIRW -type f -exec sed -i 's/<checkOutDate>/<endDate>/g' {} \;
find $DIRW -type f -exec sed -i 's/<checkInTime>/<startTime>/g' {} \;
find $DIRW -type f -exec sed -i 's/<checkOutTime>/<endTime>/g' {} \;
find $DIRW -type f -exec sed -i 's/<nights>/<days>/g' {} \;
find $DIRW -type f -exec sed -i 's/<pickupAddress>/<startAddress>/g' {} \;
find $DIRW -type f -exec sed -i 's/<returnAddress>/<endAddress>/g' {} \;
find $DIRW -type f -exec sed -i 's/<pickupDate>/<startDate>/g' {} \;
find $DIRW -type f -exec sed -i 's/<returnDate>/<endDate>/g' {} \;
find $DIRW -type f -exec sed -i 's/<pickupTime>/<startTime>/g' {} \;
find $DIRW -type f -exec sed -i 's/<returnTime>/<endTime>/g' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment