#!/bin/bash
from=$1
to=$2
shift 2
for file in "$@"; do
  mv $file ${file/$from/$to}
done
