diff --git a/renext b/renext index a833ae1..52f3e3a 100755 --- a/renext +++ b/renext @@ -2,7 +2,9 @@ # renext - Mass File Rename By "Extension" # Copyright (c) 2006 TundraWare Inc., Des Plaines, IL USA # All Rights Reserved -# $Id: renext,v 1.102 2006/02/09 00:56:42 root Exp $ +# $Id: renext,v 1.103 2006/02/09 07:53:45 root Exp $ + + if [ $# != 2 ] then @@ -10,10 +12,10 @@ echo " Renames files ending with '.oldext' to end with '.newext'" else - for f in *.${1} + for f in `ls *$1 2>/dev/null` do - tgt=`echo $f | sed s/\.$1$/\.$2/` - echo $f $tgt + tgt=`echo $f | sed s/\.${1}$/\.${2}/` + mv -v $f $tgt done fi