From owner-freebsd-questions Fri Aug 2 16:35:20 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E588F37B407 for ; Fri, 2 Aug 2002 16:35:08 -0700 (PDT) Received: from smtp6.mindspring.com (smtp6.mindspring.com [207.69.200.110]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2621743E42 for ; Fri, 2 Aug 2002 16:35:08 -0700 (PDT) (envelope-from kylebutt@myrealbox.com) Received: from user-112vpc6.biz.mindspring.com ([66.47.229.134] helo=kylebutt.dorms.usu.edu) by smtp6.mindspring.com with esmtp (Exim 3.33 #1) id 17alwo-0003jR-00; Fri, 02 Aug 2002 19:35:06 -0400 Received: from kylebutt.dorms.usu.edu (2d30ffc1ee241b6ab4b50c9e48679bcd@localhost [127.0.0.1]) by kylebutt.dorms.usu.edu (8.12.5/8.12.5) with ESMTP id g72NZ3Ja000421; Fri, 2 Aug 2002 17:35:04 -0600 (MDT) (envelope-from kylebutt@myrealbox.com) Received: (from kyle@localhost) by kylebutt.dorms.usu.edu (8.12.5/8.12.5/Submit) id g72NYsWZ000417; Fri, 2 Aug 2002 17:34:54 -0600 (MDT) (envelope-from kylebutt@myrealbox.com) X-Authentication-Warning: kylebutt.dorms.usu.edu: kyle set sender to kylebutt@myrealbox.com using -f Date: Fri, 2 Aug 2002 17:34:52 -0600 From: Kyle Butt To: "Pietralla, Siegfried P" Cc: freebsd-questions@freebsd.org Subject: Re: files to files with .txt Message-ID: <20020802173452.A368@kylebutt.dorms.usu.edu> Mail-Followup-To: "Pietralla, Siegfried P" , freebsd-questions@freebsd.org References: <16649A8D5C73D51183B80008C728EEB7CC0AD5@AUSYM103> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <16649A8D5C73D51183B80008C728EEB7CC0AD5@AUSYM103>; from siegfried.pietralla@eds.com on Fri, Aug 02, 2002 at 01:58:20PM +1000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Aug 02, 2002 at 01:58:20PM +1000, Pietralla, Siegfried P wrote: > > -----Original Message----- > > From: John Mills [mailto:jmmills@telocity.com] > > Sent: Friday, 2 August 2002 12:07 > > To: Maciej Szewczyk > > Cc: questions@FreeBSD.ORG > > Subject: Re: files to files with .txt > > > > > > Hello - > > > > On Wed, 31 Jul 2002, Maciej Szewczyk wrote: > > > > > Hi, > > > I have about 1000 files. > > > ls -1 > > > 1 > > > 2 > . > . > . > > > And now I must have 1000 files with .txt -> > > > ls -1 > > > 1.txt > > > 2.txt > . > . > . > > > > DISCLAIMER - This is on-the-fly - you'll probably need to > > tune it and/or > > correct it. Of course you could just write it as a [bash] > > script. Get the > > form right _without_ the 'mv' line, and if possible save a > > copy of your > > directory before you munge the real files. > > > > $ ls > ../1000_files > > $ for FILENAME in `cat ../1000_files` > > > do > > > echo "Renaming $FILENAME to $FILENAME.txt" > > > mv $FILENAME $FILENAME.txt > > > done > > Renaming 001 to 001.txt > > .... > > > > $ > > > > - John Mills > > i've found that the easiest ( and least typing ) way to check stuff like > this is to : > > for i in * ; do echo mv $i $i.txt ; done > > to see what you're going to get, then just append " | sh " ; or just remove the echo. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message