[ -z "$1" ] && exit for i in pom.xml */pom.xml do V=`head -20 $i | grep "" | head -1 | cut -d ">" -f2 | cut -d "<" -f1` perl -pi -e "s;$V;$1;" $i echo $V $i done perl -pi -e "s;$V;$1;" \ archetype/src/main/resources/archetype-resources/pom.xml