Ubuntu 22.04/24.04 软件源配置:3大国内镜像站实测与一键切换脚本
2026/7/6 2:02:48
ed命令用于文本编辑,其选项如下:
--p string:将ed的提示符设置为指定的字符串,默认字符串为空,即无提示符。
--s:抑制诊断信息,在脚本中使用很有用。
$ 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 # Qui