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

Re: list duplicate filenames which only vary by case



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]) ]]',)

-- 
Mikael Magnusson



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