From owner-freebsd-questions@FreeBSD.ORG Wed Sep 3 18:55:46 2003 Return-Path: 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 1CE3A16A4BF for ; Wed, 3 Sep 2003 18:55:46 -0700 (PDT) Received: from MX4.NetWood.net (mx4.netwood.net [209.247.184.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E48643FE1 for ; Wed, 3 Sep 2003 18:55:45 -0700 (PDT) (envelope-from jonas@netwood.net) Received: from netwood.net (mail.netwood.net [209.247.184.35]) by MX4.NetWood.net (Postfix) with ESMTP id 8BA6D3EE428; Wed, 3 Sep 2003 18:55:12 -0700 (PDT) (envelope-from jonas@netwood.net) Received: from master [209.247.186.2] by netwood.net with ESMTP (SMTPD32-7.15) id ABBC47EE006A; Wed, 03 Sep 2003 18:56:12 -0700 From: "Jonas" To: "'Larry Rosenman'" , Date: Wed, 3 Sep 2003 18:56:15 -0700 Message-ID: <024501c37287$b9b341b0$0800a8c0@master> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 Importance: Normal In-reply-to: <88930000.1062638899@lerlaptop.lerctr.org> Subject: RE: How do I change the extensions on a slew of files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2003 01:55:46 -0000 > > > > Hello Know-It-Alls, > > > > If I have a directory with a whole slew of files with the same file > > extension, for example: > > > > 1-1-1.inc > > 1-1-2.inc > > 1-1-3.inc > > etc. > > > > What command can I use to change the file extension - but keep the file > > name the same - in one swell swoop? The equivalent command in Windows > > would be: > > > > C:\>ren *.inc *.htm > > > > Jonas Fornander - System Administrator > > Netwood Communications,LLC - www.netwood.net > > Find out why we're better - 310-442-1530 > > > > > from an sh type shell > for i in *.inc > do > z=`echo $i | sed -e "s/inc/htm/g"` > mv ${i} ${z} > done > > (not tested, but should work.) > > LER Tested and it works great! Thanks. Jonas Fornander - System Administrator Netwood Communications,LLC - www.netwood.net Find out why we're better - 310-442-1530