From owner-freebsd-newbies Tue May 23 0:55:52 2000 Delivered-To: freebsd-newbies@freebsd.org Received: from dt051n0b.san.rr.com (dt051n0b.san.rr.com [204.210.32.11]) by hub.freebsd.org (Postfix) with ESMTP id 85D3037B5BA for ; Tue, 23 May 2000 00:55:48 -0700 (PDT) (envelope-from DougB@gorean.org) Received: from gorean.org (doug@master [10.0.0.2]) by dt051n0b.san.rr.com (8.9.3/8.9.3) with ESMTP id AAA43116; Tue, 23 May 2000 00:55:42 -0700 (PDT) (envelope-from DougB@gorean.org) Message-ID: <392A397E.12EA745B@gorean.org> Date: Tue, 23 May 2000 00:55:42 -0700 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.72 [en] (X11; U; FreeBSD 5.0-CURRENT-0508 i386) X-Accept-Language: en MIME-Version: 1.0 To: "Dimitrios T." Cc: freebsd-newbies@FreeBSD.org Subject: Re: batch; the other way around References: <20000522133131.95845.qmail@hotmail.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-newbies@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org "Dimitrios T." wrote: > > hi, > > I like to follow the posts of this mailing-list, I think it's yet another > way of learning FreeBSD. I liked the following solution of adding a 'txt' > "extension" (pardon my DOS :-) after a listing of files: > > for f in * > do > mv $f $f.txt > done > > Usefull, indeed. But how can one remove the 'txt' from those files (renaming > them back to the original filename). > > Is this possible? Well, the answer is in the man page for sh, but it's not 100% obvious. So, I'll tell you, if you promise to go READ the man page to figure out why it works. :) for FILE in *.txt; do mv $FILE ${FILE%\.txt} done Doug To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-newbies" in the body of the message