#!/bin/sh PACKAGE_NAME=$1 for i in ${PACKAGE_NAME}-*.config; do NEW=${PACKAGE_NAME}-$VERSION-$(echo $i | sed -e "s/${PACKAGE_NAME}//" | cut -d - -f2-) mv $i $NEW done