Renaming files (answer)
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
Increase ad revenue 50-250% with Ezoic