[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sed question about newline -> cr/lf conversion
From: |
Albert Chin |
Subject: |
Re: sed question about newline -> cr/lf conversion |
Date: |
Wed, 17 Apr 2002 00:27:32 -0500 |
User-agent: |
Mutt/1.2.5i |
On Tue, Apr 16, 2002 at 11:12:06PM -0600, Lynn Wilson wrote:
> If I run sed on a binary executable file that perchance has \n (0xa)
> characters in it, the resulting output (without substitution) has
> those changed to CR-LF.
>
> Is there a way to disable this conversion?
>
> I'm running cygwin on a MS-Win2K system.
>
> I really don't want to modify the application to test for file type prior to
> running sed on it.
Then run sed twice. Run it the first time without substitution. If the
file size increases (just cmp the source and destination), then assume
it's a binary file. Else, run sed again with the substitution you
want.
--
albert chin (address@hidden)