bug-gnu-utils
[Top][All Lists]
Advanced

[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 13:40:22 -0500

Hi,
Thanks for your quick reply.

I am quite sure that the input file has no carriage returns, as I removed
them using tr already, then looked at the file using vi in "binary" mode (vi
-b).

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.  I was hoping that there was a way of turning that "feature" off.  

Thanks.

Roger

-----Original Message-----
From: address@hidden [mailto:address@hidden
Sent: Monday, February 04, 2002 1:19 PM
To: Roger Spellman
Cc: 'address@hidden'
Subject: Re: sed for non-DOS files


Roger Spellman <address@hidden> wrote:
> I'm using GNU on a "Windows" PC.

Actually, you're using someone else's Windows port of GNU.

> I wrote a script using 'sed' to generate some C code.  However, the script
> seems to always Ctrl-M at the end of each line.

The carriage returns may be coming from sed, or may be already present
in sed's input.  Assuming your port of sed does not automatically add
a carriage return to the end of every line, you can strip off the last
character on every line by piping through "sed 's/.$//'".  Or if you
have tr, "tr -d "\015"" might remove all carriage returns.


paul



reply via email to

[Prev in Thread] Current Thread [Next in Thread]