On 6/27/07, Will Maier <[EMAIL PROTECTED]> wrote:
>
> On Wed, Jun 27, 2007 at 02:37:07PM +0200, Pieter Verberne wrote:
> > How do I rename multiple files at once?
>
> This is a function of your shell, not mv. See ksh(1), zsh(1), etc...
>
> Alternatively, you could write a simple script/function to address
> the same problem:
>
>     for FILE in *jpg; do
>         NEW=$(echo $FILE | sed -e 's/\.jpg$/_thumb.jpg/')
>         mv "${FILE}" "${NEW}"
>     done


Will, I like your use of sed on this. I did a similar thing with awk.

for i in *.jpg do
    outfile=`echo $i | awk -F. '{print $1"_thumb.jpg"}'`
    mv $i $outfile
done

Terry

Reply via email to