delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/04/03/21:05:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Thu, 3 Apr 2003 21:05:39 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: John Williams <jwilliams AT itee DOT uq DOT edu DOT au>
cc: cygwin AT cygwin DOT com
Subject: Re: Binary patch tool?
In-Reply-To: <3E8CCA9C.9010502@itee.uq.edu.au>
Message-ID: <Pine.GSO.4.44.0304032100030.21921-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Fri, 4 Apr 2003, John Williams wrote:

> Igor Pechtchanski wrote:
> > On Fri, 4 Apr 2003, John Williams wrote:
> >
> >>Hi folks,
> >>
> >>Is there a binary equivalent to the diff/patch combination?  I've
> >>written a little shell script to run "cmp -b" over a bunch of files (I'm
> >>trying to generate binary patches), but now I'm struggling with a way to
> >>actually apply those changes.
> >>
> >>I started writing a little tcl script to do it but think there must be a
> >>better way?
> >>
> >>Thanks,
> >>John
> >
> > Umm, "vim -b"?  vim *can* be used as a stream editor...
> > 	Igor
>
> Ah yes excellent!  Even better, now I don't need to create a patch file.
> In a single line I can hack Xilinx's Xygwin tools over to Cygwin.
>
> I'm doing the following
>
> for f in $( find edk -name '*.exe' -o -name '*.dll' ) do
>    vim -b -s xyg2cyg.sed $f
> done
>
> where xyg2cyg.sed contains
> :%s/xygwin1.dll/cygwin1.dll/g
> :wq
>
> Is there a way I can pass these on the command line, without needing a
> seperate little script file like this?
>
> Thanks,
> John

Sure.  The easiest for you would probably be

vim -b -c ":%s/xygwin1.dll/cygwin1.dll/g|:wq" $f

Ain't vim grand? ;-)
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Knowledge is an unending adventure at the edge of uncertainty.
  -- Leto II


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019