try this
sed -e "s/\r/\n/g" your_file_name > your_temp_file_name
this code will go through your entire code and remove the "^M" characters
and replace them with the plain and acceptable \n. The output will be redirected
to some temporary file. You may than rename files or copy them
to their original name, if so desired.
Of course, you may automate this to process a group of files by writing a
loop:
in the tcsh or csh context
foreach file (`ls *.c *.h`)
sed -e "s/\r/\n/g" $file > $file.tmp
mv $file $file.old
mv $file.tmp $file
echo $file
end
and watch your files being transformed.
Good luck.
-otto
----------------------------------------------
Otto A. Gygax ([EMAIL PROTECTED])
Digital Publishing Solutions, Software Development
Hewlett-Packard, Corvallis, Oregon
ph: (541)715-9098 / fax: (541)715-4980 / cell: (541)602-3491
-----Original Message-----
From: Pranita S [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 13, 2000 2:29 PM
To: [EMAIL PROTECTED]
Subject: carriage return
Hi,
We are currently porting a product that runs
on NT to Linux.
We use CVS as our source control system.
The problem is :
when we get a file on Linux it has \r\n as a
newline character.
If we have a muilt-line macro like
#defined xyz \
abc \
pqr
Then the gcc compiler (2.92.2) gives error as :
stray '\' in program
We do not want to write the macro on one-line as
it is not readable. Also, we do not want to have
single line for Linux and Multi-line for NT.
Our guess is that it is probably due to \r .
How do we get rid of \r on Linux ? (we are
using multi-line macros in many files.)
But, then it should work on NT also.
Pl. reply soon.
Thanks a lot.
Pranita.
__________________________________________________
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/
_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list
_______________________________________________
Redhat-devel-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-devel-list