This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Avoid collisions between parallel installations of Cygwin


According to Corinna Vinschen on 10/21/2009 4:16 AM:
> The data starts at 0x1f7cb4, so the offset is 50 bytes.  What POSIX
> tool allows to stream a file from stdin to stdout while changing
> specified binary data?  Perl, as usual, I assume, but is there some
> simple already existing tool for that?

Well, a combination of simple tools.  A chain of dd commands in a pipeline
will work from a shell script.  I just tested that:

echo 123456789012345678901234567890 > a
{ dd bs=1 count=10; printf 'binary data'; dd bs=1 skip=11; } < a > b

replaced offsets 10-21 of file 'a' with "binary data" in file 'b'.

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]