Is the ^M in unix files the "enter" in windows files? Any easy way to get them out? Many thanks.
r*u
2 楼
I got it. in VI use the command :%s/^V^M//g in unixshell sed 's/^V^M//g'foo > foo.new where ^V^M means control+v then control+M.
【在 r*u 的大作中提到】 : Is the ^M in unix files the "enter" in windows files? Any easy way to : get them out? Many thanks.
l*g
3 楼
u don't need the /g part, 'coz there will be only one ^M per line, otherwise you got a problem.
【在 r*u 的大作中提到】 : I got it. : in VI use the command :%s/^V^M//g : in unixshell sed 's/^V^M//g'foo > foo.new : where ^V^M means control+v then control+M.
r*u
4 楼
I'm not sure what this g means here. But it seems ok. Could you tell me what the problem would be? thanks.
【在 l****g 的大作中提到】 : u don't need the /g part, 'coz there will be only one ^M per line, otherwise : you got a problem.
c*v
5 楼
dos2unix
【在 r*u 的大作中提到】 : I'm not sure what this g means here. But it seems ok. Could you tell me : what the problem would be? thanks.
G*T
6 楼
dos2unix, unix2dos
【在 l****g 的大作中提到】 : u don't need the /g part, 'coz there will be only one ^M per line, otherwise : you got a problem.
r*m
7 楼
dos2unix: Command not found. how can I do?
【在 G**T 的大作中提到】 : dos2unix, unix2dos
d*n
8 楼
vi, :%s/^v^m//g
【在 r**m 的大作中提到】 : dos2unix: Command not found. : how can I do?
l*t
9 楼
dos2unix.pl xxx.dos > xxx.unix The following is the perl file. Don't forget to make it executable. #!/usr/bin/perl while(<>){ if($_ =~ /(.*)\r/) { print($1, "\n"); } else { print($_); } }