Shell命令详解与实践
1. ed命令
1.1 选项与特性
-
-p string:将ed提示符设置为指定的字符串,默认字符串为空,即无提示符。 -
-s:抑制诊断信息,对脚本编写很有用。
1.2 示例
$ cat buzz
#! /bin/ksh
integer x=17
while :
do
x=17
done
$
$ ed buzz # Use ed to edit the buzz file
47 # Character count is automatically displayed
2 # Command 2 means display line 2
integer x=17
s/17/23/ # Changes the 17 to a 23
2 # Redisplay line 2
integer x=23
3 # Display line 3
while :
q
? # Editor displays a ? when confused
q # Quit the editor,
超级会员免费看
订阅专栏 解锁全文

6730

被折叠的 条评论
为什么被折叠?



