本版版主招募中

 
标题: ksh第4章 编辑命令
xfc211
LU天使
Rank: 4



UID 790
精华 39
积分 519
帖子 882
活跃指数 -11
LU金币 1905 个
LU金条 0 个
阅读权限 80
注册 2003-10-20
 
发表于 2003-11-12 10:56  资料  个人空间  短消息  加为好友 
第4章 编辑命令

命令历史文件:通过HISTFILE变量设置;没有设置的话默认是$HOME/.sh_history
历史文件包含的命令共128条,可以通过HISTSIZE变量设置。
访问命令历史文件:可以使用fc或者in-line editor
$fc –l[nr][range]
or
$history –5

136 history -r –5 R倒排
135 man fc
134 fc
133 fl
132 print ${#CA}
131 print $CA

# fc -l -5
132 print ${#CA}
133 fl
134 fc
135 man fc
136 history -r -5
137 fc -l -5
编辑命令历史文件
fc [-e editor] [-r][range] –e 使用特定的editor,没有给出,默认读变量FCEDIT值
fc -e - [ old=new ] [ command ]

在线编辑:emacs、gmacs、vi
在线编辑通常通过EDITOR变量设置也可以$set –o option (option是emacs、gmacs、vi
通常通过$HOME/.profile 文件设置)

编辑窗口大小默认80,可以通过COLUMNS变量设置

顶部
 



当前时区 GMT+8, 现在时间是 2008-11-23 06:46
乐悠LoveUnix论坛-京ICP备05005823号

Thanks to Discuz!  © 2001-2007    Power by LoveUnix.net
Processed in 0.050811 second(s), 6 queries , Gzip enabled

清除 Cookies - 联系我们 - 乐悠LoveUnix - Archiver