Re: [Forum] Change case på filenames

From: Mads Toftum <mads@toftum.dk>
Date: Wed Apr 10 2002 - 14:13:05 CEST

On Wed, Apr 10, 2002 at 02:10:47PM +0200, Jens Rohde wrote:
> Uhm... nogen der lige ligger inde med et par linier shell-script, der kan
> konvertere alle filnavne i et dir til store eller små bogstaver... skal
> lige have ryddet op efter en windows-bruger ;)
>
Noget i stil med

#!/bin/bash
for f in *
do
   name=`basename $f`
   low=`echo $fname | tr A-Z a-z`
   if [ $f != $low ]
   then
     mv $f $low
   fi
done

vh

Mads Toftum

-- 
With a rubber duck, one's never alone.
              -- "The Hitchhiker's Guide to the Galaxy"
Received on Wed Apr 10 14:12:51 2002

This archive was generated by hypermail 2.1.8 : Tue Jul 19 2005 - 16:03:36 CEST