APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

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:

 for i in *
 j=`echo $i | tr '[A-Z]' '[a-z]'`
 mv $i $j

or in ksh:

 typeset -l L
 for i in * do
 mv $i $L

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.

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

Printer Friendly Version

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

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


"typeset -l" also works in BASH >= 4.1:

root@nappo:~# echo $BASH_VERSION
root@nappo:~# typeset -l foo
root@nappo:~# foo=BAR; echo $foo

blitzen:~# echo $BASH_VERSION
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

Dead trees and polluting ink. I'll be happy to see them go. (Tony Lawrence)


Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode