Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

S Spigarelli

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Change file name from upper to lower case

This script requires perl, and a modern shell with ls (this was written/tested using Bash). It also will not work recursively without some modifications.

for file in `ls -1|perl -ne 'print "$_" if (/[A-Z]/);'`
do
  mv ${file} `echo ${file}|perl -ne 'chomp;print "$_" if (tr/A-Z/a-z/);'`;
done
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS