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 19161
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zzapper <david@xxxxxxxxxxxxxx>
- Subject: Re: list duplicate filenames which only vary by case
- Date: Fri, 26 Sep 2014 11:35:00 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=L8aXkOsPp2M1U3m1NLAJBemdf+/UW23uC//PVY4HqcY=; b=s8obtstp99Heau9IyOjYDoWUMVc+2Pw9mRVzJrr0gkOn6YGc0yjp7ETolRZkAx4lCC McAPc8kQ+k+CELIiQYI1dAJniuLOGPJu8mlUKlBSvv4LT2pZzbBMHRgntPUyFD6kcf6l BJd4QHRzxsOsN64CAYqIjVujvElJV9ZR77uC8qnqQdSnoUbXMfVdqhwPDWyMX8IuGNOQ Pw9CaHTTRoKpff/rxr/3rGThuA5QDWkzixYi0R1z7wgzHCWd7OlQxFLT79cQQbLAb3XN Fwa746esHSW7tcEOdmGHWFZIHDr/hub047CAzlt+8OxasyuLa/eCyp7FOE+mL6B3F6uY Pu/Q==
- In-reply-to: <CAHYJk3T5RVCKhnsGMJtCLaQWLTkKQCLt1_32gU3gP-j0Pi-OeQ@mail.gmail.com>
- 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
- References: <XnsA3B46798CE2D3davidrayninfocouk@80.91.229.13> <CAHYJk3RSwz9E5GpVUnnUKaJoQddu5AsJEmDGh2dRmnd+bVfDVw@mail.gmail.com> <CAHYJk3T5RVCKhnsGMJtCLaQWLTkKQCLt1_32gU3gP-j0Pi-OeQ@mail.gmail.com>
On 26 September 2014 11:29, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> On 26 September 2014 11:27, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>> On 26 September 2014 11:11, zzapper <david@xxxxxxxxxxxxxx> wrote:
>>> Hi
>>>
>>> list files with duplicates in same directory
>>> e.g.
>>> house.jpg House.jpg hOUSE.jpg
>>>
>>> I guess it needs a e[$REPLY...] clause
>>
>> () { setopt localoptions nocaseglob; print -rl - *(e,'[[ -n
>> $REPLY(#q[2]) ]]',) }
>>
>> I couldn't figure out any syntactically valid way to insert (#i) in
>> the glob. If that were possible you wouldn't need the function and
>> local option.
>
> Of course this also works.. duh :)
> print -rl - *(e,'setopt nocaseglob; [[ -n $REPLY(#q[2]) ]]',)
Sorry for triple posting, the last version only "works" for external
commands, eg, when we fork before performing the glob, or it will
change the caseglob setting in the parent shell (for example when
using the print builtin), so I go back to recommending the first
version.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author