bin sh postfix search_mask del cur_path pwd for in find -name search_m

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#!/bin/sh
postfix=$2
search_mask=$1
del=$3
cur_path=`pwd`
for f in `find . -name \*${search_mask}` ; do
cp $f `basename $f ${postfix}`
if [[ ${del} = 1 ]];
then rm -f $f
fi
done