[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help needed in - diverting the output of diff command to a text file

From: vijayakumar . d
Subject: Re: Help needed in - diverting the output of diff command to a text file
Date: Tue, 16 Mar 2004 13:24:13 +0530

Hi Eli and Stepen,

Thanks for your reply on this problem.

Stepen is correct. 
"open the output file in WINDOWS''?" means 

1. I have creted the file in Cygwin by the command  "diff file1 file2 > 
2. I went to windows and double clicked to open the difftext.txt
3. But the alignments I see in Cygwin and Windows looks different.

This is the problem.
And Stepen gave me solution yesterday itself.

"diff a b | sed '/\r$/!s/$/\r/' >diff.txt"  command worked out.

Thanks a lot Stepen....
Vijayakumar Dharmaraj
Mailto: address@hidden

Stepan Kasal <address@hidden> 
03/16/2004 12:47 PM

Eli Zaretskii <address@hidden>
address@hidden, address@hidden, address@hidden
Re: Help needed in - diverting the output of diff command to a text file


On Mon, Mar 15, 2004 at 08:47:27PM +0200, Eli Zaretskii wrote:
> > Date: Mon, 15 Mar 2004 10:46:29 +0100
> > From: Stepan Kasal <address@hidden>
> > 
> > the problem is that the diff commands generates it's output with
> > unix-like line endings
> IMHO, that's a bug in that port of Diff: it should by default use
> Windows-style CR-LF pairs, not a single newline.

that's not so clear.  You would be right if it were a real Windows port.

If it is cygwin, OTOH, which aims to create a unix-like environment
inside windows, the situation may differ.
I'd expect that cygwin diff will be able to work with unix text files
as if I were on a unix, producing same patch files as on unix.

But it could be possible to have smart diff which would auto-detect
the eol style and would produce a consistent output...
(This seems similar to what we discussed in conection with grep.)

> To the OP: what exactly do you mean by ``open the output file in
> WINDOWS''?  What did you open it with?

Perhaps he means "double-click on .txt file", which often launches
To the OP: try running "write" or "wordpad"---perhaps the lines will
be displayed correctly then.

                 Stepan Kasal


Attachment: InterScan_Disclaimer.txt
Description: Text document

reply via email to

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