兄弟们好,请问怎样把一个(从windows里面过来的),后面的^M 给去掉?
-
- 帖子: 15
- 注册时间: 2006-06-15 20:42
兄弟们好,请问怎样把一个(从windows里面过来的),后面的^M 给去掉?
兄弟们好,请问怎样把一个程序从windows里面过来的,后面的^M 给去掉?
谢谢
谢谢
-
- 帖子: 3182
- 注册时间: 2006-03-10 15:10
- 来自: xi'an China
- 联系:
-
- 帖子: 31
- 注册时间: 2006-09-07 10:27
dos格式到unix格式吧 在linuxforum上有个帖子上有解决方案 脚本 用elisp实现
就是这个
;; convert text files between unix and dos
(defun dos-unix () (interactive)
(goto-char (point-min))
(while (search-forward "\r" nil t) (replace-match "")))
(defun unix-dos () (interactive)
(goto-char (point-min))
(while (search-forward "\n" nil t) (replace-match "\r\n")))
定义了两个命令unix-dos dos-unix
就是这个
;; convert text files between unix and dos
(defun dos-unix () (interactive)
(goto-char (point-min))
(while (search-forward "\r" nil t) (replace-match "")))
(defun unix-dos () (interactive)
(goto-char (point-min))
(while (search-forward "\n" nil t) (replace-match "\r\n")))
定义了两个命令unix-dos dos-unix
-
- 帖子: 2841
- 注册时间: 2006-09-11 22:47
- 千里孤坟
- 帖子: 212
- 注册时间: 2005-12-08 16:53
- 联系:
- kofshower
- 帖子: 1343
- 注册时间: 2007-03-13 11:23
- 联系:
记着千里孤坟 写了:楼上的那段表达式不能直接用的,因为这“^M”是控制符,不能用“^”+“M”的方式输入。正确的办法是在终端下按住Ctrl+V,然后再迅速按M(或者Ctrl+V+M一起按),这样输入的“^M”其实是一个字符而不是两个,它会被视作一个有效的控制符。
"We are all in the mud, but some of us are looking at the stars." (Oscar Wilde)
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
We are not born for ourselves.
人生天地间,并非为自己
Homepage:http://sites.google.com/site/polarisnotme/
-
- 帖子: 10
- 注册时间: 2008-07-11 11:05
- 来自: 山东青岛
- carbont
- 帖子: 3406
- 注册时间: 2007-11-22 10:20
- 来自: 北京
- solcomo
- 帖子: 2838
- 注册时间: 2007-04-25 13:12
- jarodlau
- 帖子: 501
- 注册时间: 2005-09-06 20:34
- 联系: