[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Filename case



No python, no fancy stuff, nothing but plain old bash:

	for i in *; do
		j=`echo $i | tr '[A-Z]' '[a-z]'`
		if [ "$i" != "$j" ]; then
			mv $i $j
		fi
	done

Or on a single line:

for i in *; do j=`echo $i | tr '[A-Z]' '[a-z]'`; if [ "$i" != "$j" ]; 
then mv $i $j; fi; done

Phil.




Reply to: