Chinaunix

标题: 问问这是个什么用法? [打印本页]

作者: hwxo    时间: 2008-08-13 11:29
标题: 问问这是个什么用法?
!:0 !:*
作者: ly5066113    时间: 2008-08-13 11:31
原帖由 hwxo 于 2008-8-13 11:29 发表
!:0 !:*


断章取义,无可奉告。
作者: hwxo    时间: 2008-08-13 11:33
没有的,直接输入这个,会有输出的。
作者: hwxo    时间: 2008-08-13 11:38
[root@monitor perltest]# echo 111 323  543 4
111 323 543 4
[root@monitor perltest]# !:0 !:*
echo 111 323 543 4
111 323 543 4
作者: hwxo    时间: 2008-08-13 11:39
[root@monitor perltest]# echo 111 323  543 4
111 323 543 4
[root@monitor perltest]# !:2-3:p
323 543


怪怪的。
作者: ly5066113    时间: 2008-08-13 11:41
原帖由 hwxo 于 2008-8-13 11:39 发表
[root@monitor perltest]# echo 111 323  543 4
111 323 543 4
[root@monitor perltest]# !:2-3:p
323 543


怪怪的。


man bash

       !      Start  a  history substitution, except when followed by a blank,
              newline, = or (.
       !n     Refer to command line n.
       !-n    Refer to the current command line minus n.
       !!     Refer to the previous command.  This is a synonym for `!-1'.
       !string
              Refer to the most recent command starting with string.
       !?string[?]
              Refer to the most recent command containing string.  The  trail-
              ing ? may be omitted if string is followed immediately by a new-
              line.
       ^string1^string2^
              Quick substitution.  Repeat the last command, replacing  string1
              with string2.  Equivalent to ``!!:s/string1/string2/'' (see Mod-
              ifiers below).
       !#     The entire command line typed so far.
作者: hwxo    时间: 2008-08-13 11:47
多谢楼上的兄弟。
man bash,没试过,我好好看看先。
作者: blackold    时间: 2008-08-13 11:48
标题: 回复 #1 hwxo 的帖子
history expansion吧。
作者: wtuter    时间: 2008-08-15 03:47
":"什么意思




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2