[go: up one dir, main page]

Menu

[897c37]: / bin / Fixappend  Maximize  Restore  History

Download this file

23 lines (17 with data), 379 Bytes

#!/bin/sh

USAGE="Fixappend <orig> <new>
Fixes all files in the current directory and 
subdirectories ending in .<orig> and renames them with .<new>."

if [ $# -ne 2 ]; then
    printf "%s\n" "$USAGE"
    exit 1
fi

all=`find . -name *.$1`
#echo All=$all

for i in $all
do
    base=`echo $i | cut -d. -f1-2` 
    newname=$base.$2
    echo mv $i $newname
    mv $i $newname
done