Summary: Control characters in shell file

From: Smith, Mike R. <smithmr_at_bowater.com>
Date: Wed, 29 Jan 2003 08:57:20 -0500

Thanks to the many of you who responded. Since you took the time to respond, I will take the time to list you.

Somehow Emacs is acting like a windows based environment and is putting carriage returns in the files.
Several solutions were presented, which are quite simple. I used the one at the tool but I see that many of the others should work too. It just depends on whether you want to fix it from inside the file or outside the file.

:%s%<control-V><control-M>$%% (use vi to get rid of them)

The MTOLLS subset has a dos2unix prog that will remove them

tr -d '\015' < dosfile > unixfile <- simplification, but it'll do

cat file_name | col -b > new_file_name

strings originalfile > newfile

sed -e 's/^M//g' <filename> > <new_filename>

The ^M characters are the end of line markers put in by DOS/Windows. The
easiest way to get rid of them is to use emacs replace. To get the ^M, you
need to use CTRL-Q - CTRL-M and replace with null.

Thanks to Chris Bryant, Thomas Sjolshagen, Galen Johnson, Dr. Thomas Blinn, Charles Ballowe, Brajesh Kumar, Phillip Brown, Blehl Blake, Premjit Nair, Jesper Frank Nemholt, Keith Texel, Joerg Bruehe, Matthew Wild, Mark Deiss, Harm Enging.
Received on Wed Jan 29 2003 - 13:58:18 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:44 NZDT