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.

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