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

Re: capitalizing file names



On Apr 26, 12:16am, Phil Pennock wrote:
}
} >   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.)

Since you've already established that MacOS doesn't mishandle a "mv" where
the source and destination file names refer to the same file, it should
work just to do:

zmv -f '(*).(*)' '${(C)1}.${2:u}'

In general, though, I'd think this must be done in two steps.  E.g.:

% zmv '(*).(*)' 'tmp_${(C)1}.${2:u}'
% zmv 'tmp_(*)' '$1'



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