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

Unix, Xenix and ODT General FAQ


Some material is very old and may be incorrect today

© December 2003 (various)

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.


If you found something useful today, please consider a small donation.



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


Inexpensive and informative Apple related e-books:

Digital Sharing Crash Course

Take Control of Parallels Desktop 12

Take Control of Preview

Take Control of Pages

Take Control of IOS 11








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

gravatar


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

[email protected]:~# echo $BASH_VERSION
4.1.5(1)-release
[email protected]:~# typeset -l foo
[email protected]:~# 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





I have been complimented many times and they always embarrass me; I always feel that they have not said enough. (Mark Twain)




Linux posts

Troubleshooting posts


This post tagged:

FAQ



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode