From owner-freebsd-questions@FreeBSD.ORG Sat Jan 5 06:46:08 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B18C16A479 for ; Sat, 5 Jan 2008 06:46:08 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mta5.srv.hcvlny.cv.net (mta5.srv.hcvlny.cv.net [167.206.4.200]) by mx1.freebsd.org (Postfix) with ESMTP id 6BE4313C43E for ; Sat, 5 Jan 2008 06:46:08 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from flosoft.no-ip.biz (ool-435559b8.dyn.optonline.net [67.85.89.184]) by mta5.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTP id <0JU500F3YS4V8YG0@mta5.srv.hcvlny.cv.net> for freebsd-questions@freebsd.org; Sat, 05 Jan 2008 01:46:08 -0500 (EST) Received: from flosoft.no-ip.biz (localhost [IPv6:::1]) by flosoft.no-ip.biz (8.14.2/8.14.2) with ESMTP id m056k6kf000417; Sat, 05 Jan 2008 01:46:07 -0500 Date: Sat, 05 Jan 2008 01:46:06 -0500 From: "Aryeh M. Friedman" In-reply-to: <5DFF4360-3A4A-44B7-A85C-FD6CBF3930BA@gmail.com> To: Shantanoo Mahajan Message-id: <477F27AE.4040807@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7BIT X-Enigmail-Version: 0.95.5 References: <2b98f2f70801042134x1af4f721s877677afde7151f5@mail.gmail.com> <477F1D54.3040807@gmail.com> <5DFF4360-3A4A-44B7-A85C-FD6CBF3930BA@gmail.com> User-Agent: Thunderbird 2.0.0.9 (X11/20080104) Cc: Jeff Laine , freebsd-questions@freebsd.org Subject: Re: batch rename X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jan 2008 06:46:08 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Shantanoo Mahajan wrote: > > On 05-Jan-08, at 11:31 AM, Aryeh M. Friedman wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 >> >> Jeff Laine wrote: >>> Hi to all. >>> >>> My goal is to rename several files in such a way as to >>> decapitalize starting letters in their names. The solution >>> seems to be simple but I'm stuck. What should I use? awk/sed or >>> write some shell-script? >> >> This assumes tcsh: >> >> foreach i (`ls [A-Z][a-z]*`) mv $i `echo $i|tr 'A-Z' 'a-z'` end >>> > > tr will decapitalize all the letters in the string. > You can replace it with the following sed then sed s/^[A-Z]/[a-z]/ - -- Aryeh M. Friedman FloSoft Systems, Java Developer Tools http://www.flosoft-systems.com Developer, not business, friendly. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHfyeujRvRjGmHRgQRAq93AKCX5RmMVI436s4fHnFL5Lbf7ZFu9QCfXnQi BmYgPvB6m+1WlpeF9YXQd80= =SsIF -----END PGP SIGNATURE-----