Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Jan 2008 12:22:33 +0530
From:      Shantanoo Mahajan <shantanoo@gmail.com>
To:        "Aryeh M. Friedman" <aryeh.friedman@gmail.com>
Cc:        Jeff Laine <wtf.jlaine@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: batch rename
Message-ID:  <0607A2F6-E81D-4B12-85E3-2CF46CBFE2C9@gmail.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0607A2F6-E81D-4B12-85E3-2CF46CBFE2C9>