On Wednesday, May 22, 2002, at 01:35 , John W. Krahn wrote:
> Paul Company wrote:
>>
>> I want to replace a string "/usr/local" with another
>> string "/tmp/local" in a binary file.
>
> perl -0777pi~ -e's^/usr/local^/tmp/local^' mybinaryfile.out

way too freaky.... it works...  but I am having
problems with the verification - since I just
ran this against an od -c /usr/local/bin/perl
and I find places in it in which there are instances
of "/usr/local" that do not show up as "/tmp/local"
in the version I just created with the above....

[..]
> Perl has no problem reading and writing binary data.
[..]
> open IN, $file or die "Can't open $file for reading: $!";
> binmode IN;  # not required on *nix OSs

I am now officially WAY confused here....

When I first read your response John - i thought to myself,

        "Oh dear - this must be one of those Win32 things,
                that I have not taken the time to read about...."

then I find out that SAGE is an extension of the usenix organization
        - The System Administrator Guild -
hence that the reference to 'binmode' here is not going to be of
much use to the typical usenixy.....

At which point I go back to my initial emotional crisis - namely

        MY GOD MAN! THE DAYS OF PATCHING EXECUTABLES WITH SED.....



ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to