由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - 关于emacs一问。
相关主题
Re: 为什么emacs自动给我加^M.文件改名一问?
Perl问题求助[转载] Re: X-Win32一问
帮帮忙,用C作一个SHELLSolaris问题一问
pkgadd on Solaris安装solaris 10一问
CGI之Perl Script一问GCC 一问
xterm显示不了颜色how to remove ^M in my file
怎样在english的solaris下添加中文输入法how to get rid of the ^M in files?
One question on Solaris EmacsRe: CVS question
相关话题的讨论汇总
话题: tmp话题: file话题: emacs话题: open话题: cannot
进入Unix版参与讨论
1 (共1页)
c******t
发帖数: 31
1
用emacs打开别的text editor编辑的文件,每行末尾都有一个"^M"。
能去掉吗?看着真别扭。
谢谢。
p**h
发帖数: 99
2
you can try 'dos2unix'.

【在 c******t 的大作中提到】
: 用emacs打开别的text editor编辑的文件,每行末尾都有一个"^M"。
: 能去掉吗?看着真别扭。
: 谢谢。

c******t
发帖数: 31
3
what is this?
Is it included in emacs?
Thank you.

【在 p**h 的大作中提到】
: you can try 'dos2unix'.
M****d
发帖数: 26
4
It is a command in unix, because unix and dos treat "enter" differently.

【在 c******t 的大作中提到】
: what is this?
: Is it included in emacs?
: Thank you.

r***r
发帖数: 25
5

or if ur unix doesn't hv it (i think all solaris hv this command)
u can use a simple perl script.
#!/usr/local/bin/perl
require "flush.pl";
$TMP_FILE = "/tmp/dos2unix.tmp";
foreach $f (@ARGV) {
if ( -f $f) {
print "Processing $f ..."; &flush( STDOUT);
open( OUT, "> $TMP_FILE") || die "Cannot open tmp file for writing\n";
open( IN, "< $f") || die "Cannot open tmp file for reading\n";
while( $line = ) {
$l = length( $line);
if ( ( $l

【在 p**h 的大作中提到】
: you can try 'dos2unix'.
c******t
发帖数: 31
6
Thank you very much!

【在 r***r 的大作中提到】
:
: or if ur unix doesn't hv it (i think all solaris hv this command)
: u can use a simple perl script.
: #!/usr/local/bin/perl
: require "flush.pl";
: $TMP_FILE = "/tmp/dos2unix.tmp";
: foreach $f (@ARGV) {
: if ( -f $f) {
: print "Processing $f ..."; &flush( STDOUT);
: open( OUT, "> $TMP_FILE") || die "Cannot open tmp file for writing\n";

h******a
发帖数: 198
7
onliner.
perl -pi -e 's/\cM//g' *

【在 r***r 的大作中提到】
:
: or if ur unix doesn't hv it (i think all solaris hv this command)
: u can use a simple perl script.
: #!/usr/local/bin/perl
: require "flush.pl";
: $TMP_FILE = "/tmp/dos2unix.tmp";
: foreach $f (@ARGV) {
: if ( -f $f) {
: print "Processing $f ..."; &flush( STDOUT);
: open( OUT, "> $TMP_FILE") || die "Cannot open tmp file for writing\n";

a****f
发帖数: 29
8
solaris: dos2unix
linux: fromdos, todos
Also,
$ cat file | tr -d '\r' > newfile

【在 c******t 的大作中提到】
: what is this?
: Is it included in emacs?
: Thank you.

1 (共1页)
进入Unix版参与讨论
相关主题
Re: CVS questionCGI之Perl Script一问
"Find ... -exec ..." script never ends.xterm显示不了颜色
安装 Solaris 8 x86 和 Win2K 小记怎样在english的solaris下添加中文输入法
Re: how to change all the files .cpp to .COne question on Solaris Emacs
Re: 为什么emacs自动给我加^M.文件改名一问?
Perl问题求助[转载] Re: X-Win32一问
帮帮忙,用C作一个SHELLSolaris问题一问
pkgadd on Solaris安装solaris 10一问
相关话题的讨论汇总
话题: tmp话题: file话题: emacs话题: open话题: cannot