From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7c42bb46 for ; Sat, 6 Apr 2019 19:43:48 +0000 (UTC) Received: (qmail 1220 invoked by alias); 6 Apr 2019 19:43:35 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 23902 Received: (qmail 17296 invoked by uid 1010); 6 Apr 2019 19:43:35 -0000 X-Qmail-Scanner-Diagnostics: from 195.159.176.226 by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.1/25405. spamassassin: 3.4.2. Clear:RC:0(195.159.176.226):SA:0(-1.1/5.0):. Processed in 2.348374 secs); 06 Apr 2019 19:43:35 -0000 X-Envelope-From: gcszu-zsh-users@m.gmane.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at m.gmane.org does not designate permitted sender hosts) X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: zsh-users@zsh.org To: zsh-users@zsh.org From: Emanuel Berg Subject: Re: find duplicate files Date: Sat, 06 Apr 2019 21:42:51 +0200 Message-ID: <86mul2apj8.fsf@zoho.eu> References: <86v9zrbsic.fsf@zoho.eu> <20190406130242.GA29292@trot> <86tvfb9ore.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Mail-Copies-To: never Cancel-Lock: sha1:JrKev45fq5tQxEAMXT9yc2AIfmA= zv wrote: >> Cool, but doesn't seem to work? >> > > Forgot to ignore the second field. > > #!/bin/zsh > find-duplicates () { > (( # > 0 )) || set -- *(.N) > local dups=0 > md5sum $@ | sort | awk '{ print $2,$1 }' | uniq -c -f1 | \ > grep -v '^ *1 ' | wc -l | read dups > (( dups == 0 )) && echo "no duplicates" > } Still nothing :) What's with the third line BTW? Looks like a comment to me and my editor interprets it that way as well. But changing it to $# doesn't help :( -- underground experts united http://user.it.uu.se/~embe8573