Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 1996 18:37:21 -0600 (MDT)
From:      Kenneth Ingham <ingham@i-pi.com>
To:        hmmm@alaska.net (hmmm)
Cc:        questions@freebsd.org
Subject:   Re: multiple files
Message-ID:  <199609250037.SAA26746@cube.i-pi.com>
In-Reply-To: <Pine.BSF.3.95.960924203341.562B-100000@hmmm.alaska.net> from "hmmm" at Sep 24, 96 08:36:48 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> how can i rename multiple files w/o doing it 1-by-1?
> 
> abc.tar.gz > abc.tgz
> def.tar.gz > def.tgz
> hij.tar.gz > hij.tgz
> 
> ??? (sh shell)

#! /bin/sh
for f in *.tar.gz
do
    mv $f `echo $f | sed 's/tar\.gz$/tgz/'`
done

Kenneth



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609250037.SAA26746>