Path Case Script

From ProjectWiki
Revision as of 04:43, 1 August 2011 by 217.108.237.125 (Talk)
Jump to: navigation, search

Script to change the case of all files and directories under a given path

Contents

What is this?

Quickie shell script to convert the case of all files within a given path to either uppercase or lowercase. This is often required when moving files between windows and unix style operating systems.

The scripts options are as follows:

usage ./pathChangeCase.sh PATH/TO/CHANGE/CASE [upper|lower] [verbose]
  • PATH/TO/CHANGE/CASE - the path you wish to change
  • upper|lower - either upper or lower here determines which way the case will be converted (default is upper)
  • verbose - if this argument exists will display to terminal what it is moving for verification

It is based on another script found earlier, but added arguments, checks for proper paths and if renaming is needed, verbose mode, and restricted the case conversion to only that part of the path after what is specified on the command line. ;;


  • todo: Hmmz, a thought, since foreach sometimes delimits on " " rather than exclusively "\n", should either set the delimiter enviroment var or use the execute mechanism built into the find command? @_@

I'm out of laegue here. Too much brain power on display!

Disclaimer!

Disclaimer!!! I'm not responsible for any mishaps this script may result in! It works for me but please, use with caution.

Personal tools
irssi scripts
eggdrop scripts