Originally Published: Tuesday, 14 September 1999 Author: Mike Baker
Published to: news_enhance_tuneup/TuneUp News Page: 1/1 - [Printable]

Perl one liners

The Support section is running an article I thought was rather interesting - LinuxPlanet.com: Ten Neat Tricks With Perl. It's just a few nice oneliners you can put in your .bashrc.

For example to make a command named lower that converts all filenames in the current directory to lower case add this to your ~/.bashrc:
function lower { perl -e 'for (@ARGV) { rename $_, lc($_) unless -e lc($_); }' * ; }

- Mike Baker (mbm@linux.com)