Vi substitution question?

Jerry Feldman gaf at blu.org
Tue Apr 4 11:17:56 EDT 2000


On 4 Apr 2000, at 11:04, Phil Buckley wrote:

> I just had a windows guy muck up a perl file and now each line ends with the dreaded "^M".
> 
> My problem is I try to run :1,$s/^M//g but it doesn't seem to see the 
^M's, is there a key combo I should be using besides the carrot on top of 
my 6 key to put in that "^" ?
I can't answer the question in the vi context off the top of my head, but it 
is easy in emacs, just do a regular expression match. ControlQ allows 
you to quote another control character. 

In vi, possibly:
:s/\0d$//
There are also several instances of programs, called dos2unix which do 
this. 


Jerry Feldman <gaf at blu.org>
Associate Director
Boston Linux and Unix user group
http://www.blu.org
-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list