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

Re: RFT: Request for a trick :O)



From: Peter Stephenson <pws@xxxxxxx>
Subject: Re: RFT: Request for a trick :O) 
Date: Mon, 08 Aug 2005 17:02:29 +0100

Hi,

 ...oh sorry..I think I have caused more confusion as I had
 intended...:)

 The script was speculativ (and buggy)...just a thought written down
 in an email.

 The corrected script is:

    #!/bin/zsh
    function zipcmp ()
    {
     cmp -s <(7z x -so $1 2>/dev/null ) <(7z x -so $2 2>/dev/null )    
    }
       
    
    if zipcmp $1 $2
    then
     echo "$1 and $2 are identical..."
    fi

 which works fine for me.

 When I will struggle again about similiar things, an email will be on
 the way... :O)

 If you find any bug or things to improve in the above script, please
 email me...I will use this script as a base for a
 compare-files-and-remove-doubles-script...


 Happy zshing!
 Meino



 

> Meino Christian Cramer wrote:
> >  How can I get the return code of cmp, if <( is implemented as a pipe
> >  ?
> 
> You may be running across a problem that someone else did recently,
> that if a program running in the shell gets a SIGPIPE the shell pretends
> it did when it's running interactively, and so aborts.  This isn't
> particularly useful and we changed it on the head of the main line.
> However, I can't get it to happen at all at the moment.
> 
> If that's not the problem (the shell is not aborting at the cmp), please
> say what is.
> 
> 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.
> 
> **********************************************************************
> 



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