Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jan 2001 22:11:56 +0100
From:      Cliff Sarginson <cliff@raggedclown.net>
To:        Peter Brezny <peter@sysadmin-inc.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: A simple shell question, How do i rename multiple files?
Message-ID:  <20010109221156.C1287@buffy.raggedclown.net>
In-Reply-To: <003101c07a95$b24117a0$46010a0a@sysadmininc.com>; from peter@sysadmin-inc.com on Tue, Jan 09, 2001 at 03:41:31PM -0800
References:  <003101c07a95$b24117a0$46010a0a@sysadmininc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Jan 09, 2001 at 03:41:31PM -0800, Peter Brezny wrote:
> I've got a bunch of files all ending in the same extension (somename.xxx)
> 
> I want to rename all of them to just (somename)
> 
> I've tried
> mv *.xxx * 
> 
> the same format with cp
meaning what ? The above cp command will fail unless by chance
the very last file expanded by "*" is a directory, then it will
cp all .xxx files and all files into that directory .. which I am
sure is not what you understand it to do.
> 
> i've read the mv man page.
> 
for i in *.xxx; do mv $i `echo $i | sed "s/\.xxx//"`; done

Cliff



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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