batch rename

Aryeh M. Friedman aryeh.friedman at gmail.com
Fri Jan 4 22:46:08 PST 2008


-----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-----



More information about the freebsd-questions mailing list