From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11458 invoked from network); 8 Aug 2005 15:43:43 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 8 Aug 2005 15:43:43 -0000 Received: (qmail 1049 invoked from network); 8 Aug 2005 15:43:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Aug 2005 15:43:35 -0000 Received: (qmail 4539 invoked by alias); 8 Aug 2005 15:43:25 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9269 Received: (qmail 4423 invoked from network); 8 Aug 2005 15:43:24 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 8 Aug 2005 15:43:24 -0000 Received: (qmail 98669 invoked from network); 8 Aug 2005 15:43:23 -0000 Received: from p5485203b.dip0.t-ipconnect.de (HELO solfire) (84.133.32.59) by a.mx.sunsite.dk with SMTP; 8 Aug 2005 15:43:17 -0000 Received: from localhost ([127.0.0.1]) by solfire with esmtp (Exim 4.42) id 1E29nl-0000pH-A4; Mon, 08 Aug 2005 17:44:39 +0200 Date: Mon, 08 Aug 2005 17:44:28 +0200 (CEST) Message-Id: <20050808.174428.74748814.Meino.Cramer@gmx.de> To: pws@csr.com Cc: zsh-users@sunsite.dk From: Meino Christian Cramer In-Reply-To: <23359.1123497689@csr.com> References: <200508081004.j78A4Es4006122@news01.csr.com> <20050808103515.GB28454@artesyncp.com> <23359.1123497689@csr.com> X-Mailer: Mew version 4.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Rcpt-To: pws@csr.com, zsh-users@sunsite.dk X-SA-Exim-Mail-From: Meino.Cramer@gmx.de Subject: Re: RFT: Request for a trick :O) Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SA-Exim-Version: 4.1+cvs (built Sat, 28 Aug 2004 13:10:40 +0200) X-SA-Exim-Scanned: Yes (on solfire) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 From: Peter Stephenson Subject: Re: RFT: Request for a trick :O) Date: Mon, 08 Aug 2005 11:41:29 +0100 Hi, thanks for all the help ! :) I did not need the exact position and byte counts of differing bytes at all. I only need a "yes" or "no" whether I have identical file (and can delete the doublettes). I saw this "broken pipe"-thingy and didnt dare to delete files on the base of this...I thought I did something very wrong (I amstill a very new zsher ;). "Broken pipe" means: different files. Ok...if my memory serves me right...the return status of the last command in a pipe is the return status of the whole pipe, isn't it ? But unfortunately, the cmp is the first command in that construction... I think with something like function zipcmp () { cmp <(7z x -so $1 2>/dev/null ) <(7z x -so $2 2>/dev/null ) } if [ ! zipcmp $1 $2 ] then rm -f $1 fi I mostly would get an empty harddisc.... ;) How can I get the return code of cmp, if <( is implemented as a pipe ? Keep zshing! Meino > Stephane Chazelas wrote: > > > > Extracting GlassBowl001.blend/usr/bin/7z: line 2: 5488 Broken pipe > > > > /usr/lib/p7zip/7z "$@" > > > > Extracting GlassBowl001.blend/usr/bin/7z: line 2: 5492 Broken pipe > > > > /usr/lib/p7zip/7z "$@" > > > > > > > I think it's rather because cmp stops reading at the first > > difference -> so exit -> so close the pipes -> so the feeders > > get a SIGPIPE. > > > > That's normal and expected, you'd get the same with: > > > > 7z ... | cmp - other-file > > You're right. I'd assumed the files were actually identical, but reading > back I see Meino did say they weren't. The "broken pipe" is simply a > detail of the implementation of the <( ... ). > > Meino, if you want a full comparison to the end of the file, you can > use "cmp -l", which will give lots of output. Otherwise, you can redirect > 2>/dev/null in the p7zip command. > > pws > > > ********************************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > > ********************************************************************** >