- 论坛徽章:
- 0
|
这个问题问得好
man bash里的回答
- When the command history expansion facilities are being used (see HIS-
- TORY EXPANSION below), the history expansion character, usually !, must
- be quoted to prevent history expansion.
复制代码- If enabled, history expansion
- will be performed unless an ! appearing in double quotes is escaped
- using a backslash. The backslash preceding the ! is not removed.
复制代码
不过奇怪的是,结果和man的描述不符
只好
不过事实上,这样的问题只在命令行操作中可能出现,shell脚本里不会。
至于为什么shell脚本中无法使用history,我也还没找到答案,可能要向源码找答案了
[ 本帖最后由 一梦如是 于 2007-1-4 17:47 编辑 ] |
|