Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: list duplicate filenames which only vary by case
- X-seq: zsh-users 19158
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: list duplicate filenames which only vary by case
- Date: Fri, 26 Sep 2014 10:26:32 +0100
- In-reply-to: <XnsA3B46798CE2D3davidrayninfocouk@80.91.229.13>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <XnsA3B46798CE2D3davidrayninfocouk@80.91.229.13>
On Fri, 26 Sep 2014 09:11:07 +0000 (UTC)
zzapper <david@xxxxxxxxxxxxxx> wrote:
> list files with duplicates in same directory
> e.g.
> house.jpg House.jpg hOUSE.jpg
Assign the contents of the directory to an array and lower-case and sort
it.
local -a array
array=(*)
array=(${(Lo)array})
Now all you need to do is search for consecutive duplicate elements in
the array (exercise for the reader). If you find one, say element i,
array=((#i)${array[i]})
should collect the ones with the names that match it.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author