Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: capitalizing file names



On 2007-04-26 at 09:57 +0400, Artur Penttinen wrote:
> > I need to rename a series of files on Mac OS X, to reflect case
> 
> > difference.  I have multi-word file names such as
> 
> > alexy_070411_1971.dng

>   autoload zmv
> 
>   zmv '(*).(*)' '${(C)1}.${2:u}'

Nope, on MacOS with its case-preserving-but-insensitive file-system that
yields:

% zmv '(*).(*)' '${(C)1}.${2:u}'
zmv: error(s) in substitution:
file exists: Alexy_070411_1971.DNG
(Probably the same file, owing to file system limitations.)

In the definition of zmv: [[ $f != $g && $f -ef $g ]]
$f is the original filename, $g is the generated filename and they're
the same file (-ef, equal file).

-Phil



Messages sorted by: Reverse Date, Date, Thread, Author