Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: capitalizing file names
- X-seq: zsh-users 11462
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: capitalizing file names
- Date: Sun, 29 Apr 2007 21:49:54 -0700
- In-reply-to: <20070426071610.GA22513@xxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <31691177567034@xxxxxxxxxxxxxxxxxx> <20070426071610.GA22513@xxxxxxxxxxxxxxxxxxxx>
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