Unix, Xenix and ODT General FAQ

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.

How can I change uppercase file names to lower case (Old Sco Unix)?

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 http://columbia.edu/kermit/utils.html.



Got something to add? Send me email.





(OLDER) <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> (SCO Unix) How can I change uppercase file names to lower case?

1 comment



Increase ad revenue 50-250% with Ezoic





Fri Mar 4 14:22:11 2011: 9355   anonymous

gravatar


"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] ..

------------------------
Kerio Samepage


Have you tried Searching this site?

Support Rates

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