Hello,
I need to rename many files in a directory recursively. I have a scripts renaming the files but it does not work recursively. The script is below;
###################
# renames.sh
# basic file renamer
criteria=$1
re_match=$2
for i in $( find ./ -name *$criteria* );
do
src=$i
tgt=$(echo $i | sed -e "s/$criteria/$re_match/")
mv $src $tgt
done
######################
If you have this kind of scripts but working recursively, please post here. Thanks for all.
Melih
I need to rename many files in a directory recursively. I have a scripts renaming the files but it does not work recursively. The script is below;
###################
# renames.sh
# basic file renamer
criteria=$1
re_match=$2
for i in $( find ./ -name *$criteria* );
do
src=$i
tgt=$(echo $i | sed -e "s/$criteria/$re_match/")
mv $src $tgt
done
######################
If you have this kind of scripts but working recursively, please post here. Thanks for all.
Melih