From owner-freebsd-questions Wed Jan 31 4:37:39 2001 Delivered-To: freebsd-questions@freebsd.org Received: from h0040f6849012.ne.mediaone.net (h0040f6849012.ne.mediaone.net [24.147.179.35]) by hub.freebsd.org (Postfix) with ESMTP id BEE4137B491 for ; Wed, 31 Jan 2001 04:37:21 -0800 (PST) Received: (from eric@localhost) by h0040f6849012.ne.mediaone.net (8.11.1/8.11.1) id f0VCalF13670; Wed, 31 Jan 2001 07:36:47 -0500 (EST) (envelope-from eric) Date: Wed, 31 Jan 2001 07:36:42 -0500 From: Eric Johnson To: Ana Romero Cc: Questions FreeBSD Subject: Re: fast answer is needed about commands Message-ID: <20010131073642.A13574@h0040f6849012.ne.mediaone.net> Reply-To: eric@coding-zone.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from anar@ees2.oulu.fi on Wed, Jan 31, 2001 at 02:24:21PM +0200 X-MUA-OS: FreeBSD 4.2-RELEASE i386 X-Uptime: 7:10AM up 5 days, 51 mins, 2 users, load averages: 0.06, 0.03, 0.00 X-Disclaimer: #include Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, Jan 31, 2001 at 02:24:21PM +0200, Ana Romero wrote: > > HI!! > > I have many files named like XXX-new which I want to move to XXX. I > mean, > > mv XXX-new XXX > > > Can I do it in once in some way? I mean, I would like to do > > mv *-new * > > but it is not allowed many ways to do this, but you could type the following commands into your /bin/sh or /usr/local/bin/bash prompt. of course, you have to be in the directory where the files are located... for i in *-new do f=`echo $i | tr -d -- -new` mv $i $f done -- Best Regards, Eric Johnson (eric@coding-zone.com && http://www.coding-zone.com) Cthulhu for President! (If you're tired of choosing the lesser of two evils.) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message