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:

 #!/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.





(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

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

------------------------


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)




FAQ



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode


SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)
www.SCOsales.com