#!/bin/sh
#
#SYNOPSIS
#  rnrp pat rpl [file]...
#
#DESCRIPTION
#  Do a string substitution on file names and within a list of files .

if [ $# -lt 2 ];then echo Usage: $0 pat rpl [file]...; exit 1; fi
pat=$1; shift
rpl=$1; shift
if [ $# -lt 1 ];then set '*'; fi

Rp "$pat" "$rpl" $*
rename "s/$pat/$rpl/g" *
