From owner-freebsd-questions@FreeBSD.ORG Sat Jan 5 06:52:42 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 5C6C716A47C for ; Sat, 5 Jan 2008 06:52:42 +0000 (UTC) (envelope-from shantanoo@gmail.com) Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.184]) by mx1.freebsd.org (Postfix) with ESMTP id 36E4D13C44B for ; Sat, 5 Jan 2008 06:52:41 +0000 (UTC) (envelope-from shantanoo@gmail.com) Received: by rv-out-0910.google.com with SMTP id l15so6879917rvb.43 for ; Fri, 04 Jan 2008 22:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:in-reply-to:references:mime-version:x-gpgmail-state:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; bh=C4rOPY/55y7htxWbSvGVn88uup8idHhZNgWYE6JLoOg=; b=EsAVt9tH7dsc3nRZOPdso7qM8u9NyaLlWoQhiOgsEpGiw+oG6vW4lENw12ehuophjNtmCdMD3JEzRg9hss/XUBBEj/UWFsnKfNhVnxDpOtPxTKB3KxvtnpMRXDSjbWE7e2LjLC7BbfxMwqwzI50T0aUYXudaR7ShC+KsSHyfN+M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=in-reply-to:references:mime-version:x-gpgmail-state:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=vT4KidQQ1KVNyqxtBUC6o8bYU/Hsf8hFS8CciWxQUnKo8ILjMUxibIlYfAvIdh1EuiLwaPKTQq+JttsQmABlB0TJ6BBlupFrnBhEDTsPvhX6pq39RojV521Epej0PkjmWUk1lMuNjagAf6hekNxh/rpzcBVos+tr/PTSx+mCWGc= Received: by 10.141.185.3 with SMTP id m3mr9357317rvp.236.1199515961481; Fri, 04 Jan 2008 22:52:41 -0800 (PST) Received: from ?192.168.0.100? ( [121.247.78.27]) by mx.google.com with ESMTPS id c14sm5377275rvf.19.2008.01.04.22.52.39 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Jan 2008 22:52:40 -0800 (PST) In-Reply-To: <477F27AE.4040807@gmail.com> References: <2b98f2f70801042134x1af4f721s877677afde7151f5@mail.gmail.com> <477F1D54.3040807@gmail.com> <5DFF4360-3A4A-44B7-A85C-FD6CBF3930BA@gmail.com> <477F27AE.4040807@gmail.com> Mime-Version: 1.0 (Apple Message framework v753) X-Gpgmail-State: !signed Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <0607A2F6-E81D-4B12-85E3-2CF46CBFE2C9@gmail.com> Content-Transfer-Encoding: 7bit From: Shantanoo Mahajan Date: Sat, 5 Jan 2008 12:22:33 +0530 To: "Aryeh M. Friedman" X-Mailer: Apple Mail (2.753) 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:52:42 -0000 On 05-Jan-08, at 12:16 PM, Aryeh M. Friedman wrote: > -----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]/ > In bash shell: $ echo AsD | sed s/^[A-Z]/[a-z]/ [a-z]sD I thought about this while sending earlier reply, but was unable to get it working properly. regards, shantanoo