functionchangeName(){ t=$(printf"%d\tpath %s,file %s "$cnt$1$2) # simple string format echo$t
if [[ $2 = *.cc ]] then new=`echo$2|sed 's/.cc/.cpp/g'` # replace mv $2$new echo $(printf"changed to ======> %s"$new) else : fi
cnt=$(( $cnt+1 )) # increase global cnt }
functiontravFolder(){ flist=`ls $1` cd$1# enter subdir that we search from
for f in$flist do iftest -d $f then #echo "dir:$f" travFolder $f#recursive, when complete, should return to parent dir else c=`pwd` changeName $c$f fi done