This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.
A simplistic script would be:
#!/bin/sh for i in * do j=`echo $i | tr '[A-Z]' '[a-z]'` mv $i $j done
or in ksh:
#!/bin/ksh typeset -l L for i in * do L=$i mv $i $L done
These are very simple, however: they aren't recursive (which means they won't descend into sub-directories) and, more importantly, they don't check to see if the lowercase name already exists.
A better program to do this is "xxu" available (C source) from https://columbia.edu/kermit/utils.html.
Got something to add? Send me email.
Dead trees and polluting ink. I'll be happy to see them go. (Tony Lawrence)
Fri Mar 4 14:22:11 2011: 9355 anonymous
"typeset -l" also works in BASH >= 4.1:
root@nappo:~# echo $BASH_VERSION
4.1.5(1)-release
root@nappo:~# typeset -l foo
root@nappo:~# foo=BAR; echo $foo
bar
blitzen:~# echo $BASH_VERSION
3.1.17(1)-release
blitzen:~# typeset -l foo
-bash: typeset: -l: invalid option
typeset: usage: typeset [-afFirtx] [-p] name[=value] ..
------------------------
Printer Friendly Version
Have you tried Searching this site?
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.
Contact us
Printer Friendly Version