[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: sed for non-DOS files
From: |
Roger Spellman |
Subject: |
RE: sed for non-DOS files |
Date: |
Mon, 4 Feb 2002 14:29:46 -0500 |
>From: Eli Zaretskii [mailto:address@hidden
>Sent: Monday, February 04, 2002 2:20 PM
>To: address@hidden
>Cc: address@hidden; address@hidden
>Subject: Re: sed for non-DOS files
>
>
>> From: Roger Spellman <address@hidden>
>> Date: Mon, 4 Feb 2002 13:40:22 -0500
>>
>> I do not know who ported my version of sed to windows, but it appears
that
>> he/she has added this annoying "feature", to make all files look like DOS
>> files.
>
>This is not an add-on feature, it's how the normal text-mode output
>works in the absolute majority of DOS/Windows implementations of the
>standard C library. The reason is that some native Windows tools,
>including the stock Windows shell itself, don't grok Unix-style text
>files where each line ends in a single \n character. For example, if
>you edit a batch file with Sed, and the result is a Unix-style file,
>the Windows shell will not run it.
Yes, but it would be nice to have an option to sed that turns off
this feature. For example, in a C program with a multi-line macro,
the last character of the line must be a backslash. GCC seems to
like UNIX style files, because GCC gives an error if the backslash
is followed by a Ctrl-M.
(By the way, this is exactly what I'm doing. I'm using sed to
generate a .c file, and GCC is complaining about the Macro
definitions. If someone can tell me how to tell GCC to ignore
the Ctrl-M's, then that would be another valid workaround)
Roger