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

Renaming files (answer)


© November 2006 Anthony Lawrence

2006/11/21

This is the answer to Detective: Renaming files

First, I did have a little hint here: I knew this customer had been thinking about buying a Mac. But the reason his files were being clobbered has to do with Mac's HFS+ file system: "Apple" and "apple" are NOT two different files. If he had begun his script with "set -o noclobber", Bash would have refused to overwrite, but as written, the "> $j" cleared out each file before the "sed" even ran.

Apple does have an optional HFSX file system which can be case sensitive. It isn't necessarily: Apple Tech Note TN1150 says:

An HFSX volume may be either case-sensitive or case-insensitive. Case sensitivity (or lack thereof) is global to the volume; the setting applies to all file and directory names on the volume. To determine whether an HFSX volume is case-sensitive, use the keyCompareType field of the B-tree header of the catalog file. A value of kHFSBinaryCompare means the volume is case-sensitive. A value of kHFSCaseFolding means the volume is case-insensitive.

Note: Do not assume that an HFSX volume is case-sensitive. Always use the keyCompareType to determine case-sensitivity or case-insensitivity.


Got something to add? Send me email.





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

Printer Friendly Version

->
-> Renaming files (answer)


Inexpensive and informative Apple related e-books:

Take Control of Pages

Take Control of Numbers

Photos: A Take Control Crash Course

Take Control of Apple Mail, Third Edition

iOS 10: A Take Control Crash Course




More Articles by © Anthony Lawrence




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





Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. (Donald Knuth)




Linux posts

Troubleshooting posts


This post tagged:

Detective



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