[flowing@srt1 ~]$ uname -a
FreeBSD srt1.sunbo.com 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun Jul 2 22:00:15 CST 2006 root@srt1.sunbo.com:/usr/src/sys/i386/compile/SUNBO.srt1 i386
[flowing@srt1 ~]$ sed -V
sed: illegal option -- V
usage: sed script [-Ealn] [-i extension] [file ...]
sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...]
[flowing@srt1 ~]$
-i extension
Edit files in-place, saving backups with the specified extension.
If a zero-length extension is given, no backup will be saved. It
is not recommended to give a zero-length extension when in-place
editing files, as you risk corruption or partial content in situ-
ations where disk space is exhausted, etc.
[flowing@sata flowing]$ sed -V
GNU sed version 4.0.7
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law
-i[suffix], --in-place[=suffix]
edit files in place (makes backup if extension supplied)作者: tdyne 时间: 2006-07-05 10:24 标题: hahaghost 兄请看清楼主的问题再回帖 需要直接存档,换句话说相当于直接编辑原文件,不使用临时文件。如果使用临时文件,就不用到这里发问啦作者: scode 时间: 2006-07-05 10:43
利用管道输入,再重定向输出。
我试了下,可以。