免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1404 | 回复: 9
打印 上一主题 下一主题

[学习共享] 在命令行输入“!”,没有提示错误,也没有输出。请问是什么意思? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-09-11 16:51 |只看该作者 |倒序浏览
在命令行输入“!”,没有提示错误,也没有输出。请问是什么意思?

论坛徽章:
145
技术图书徽章
日期:2013-10-01 15:32:13戌狗
日期:2013-10-25 13:31:35金牛座
日期:2013-11-04 16:22:07子鼠
日期:2013-11-18 18:48:57白羊座
日期:2013-11-29 10:09:11狮子座
日期:2013-12-12 09:57:42白羊座
日期:2013-12-24 16:24:46辰龙
日期:2014-01-08 15:26:12技术图书徽章
日期:2014-01-17 13:24:40巳蛇
日期:2014-02-18 14:32:59未羊
日期:2014-02-20 14:12:13白羊座
日期:2014-02-26 12:06:59
2 [报告]
发表于 2015-09-11 16:55 |只看该作者
本帖最后由 jason680 于 2015-09-11 17:03 编辑

":", "#", ... 也一样(没有任何讯息与错误)
No news is good news


$ man
...
   Event Designators
       An event designator is a reference to a command line entry in the  his‐
       tory  list.   Unless  the reference is absolute, events are relative to
       the current position in the history list.

       !      Start a history substitution, except when followed by  a  blank,
              newline,  carriage return, = or ( (when the extglob shell option
              is enabled using the shopt builtin).
       !n     Refer to command line n.
       !-n    Refer to the current command minus n.

       !!     Refer to the previous command.  This is a synonym for `!-1'.
       !string
              Refer to the most recent command preceding the current  position
              in the history list starting with string.
       !?string[?]
              Refer to the most recent command preceding the current postition
              in the history list containing string.  The trailing  ?  may  be
              omitted if string is followed immediately by a newline.

论坛徽章:
0
3 [报告]
发表于 2015-09-11 17:03 |只看该作者
回复 2# jason680


    #是什么意思?

:我知道,是一个不做任何事情的命令,返回true。并不是什么事情都没有做

论坛徽章:
145
技术图书徽章
日期:2013-10-01 15:32:13戌狗
日期:2013-10-25 13:31:35金牛座
日期:2013-11-04 16:22:07子鼠
日期:2013-11-18 18:48:57白羊座
日期:2013-11-29 10:09:11狮子座
日期:2013-12-12 09:57:42白羊座
日期:2013-12-24 16:24:46辰龙
日期:2014-01-08 15:26:12技术图书徽章
日期:2014-01-17 13:24:40巳蛇
日期:2014-02-18 14:32:59未羊
日期:2014-02-20 14:12:13白羊座
日期:2014-02-26 12:06:59
4 [报告]
发表于 2015-09-11 17:12 |只看该作者
回复 3# caiwei_cs

shell基础二十篇
http://bbs.chinaunix.net/thread-452942-1-1.html

shell 十三問?
http://bbs.chinaunix.net/thread-218853-1-1.html
   

论坛徽章:
0
5 [报告]
发表于 2015-09-11 17:19 |只看该作者
回复 4# jason680


           !      Start a history substitution, except when followed by  a  blank,
              newline,  carriage return, = or ( (when the extglob shell option
              is enabled using the shopt builtin)

没看得太懂,我的理解是!为开始一个历史的替代。和后面的内容一起才有用。

十三问我都看过,好像没有提到这个。20没看过。

论坛徽章:
145
技术图书徽章
日期:2013-10-01 15:32:13戌狗
日期:2013-10-25 13:31:35金牛座
日期:2013-11-04 16:22:07子鼠
日期:2013-11-18 18:48:57白羊座
日期:2013-11-29 10:09:11狮子座
日期:2013-12-12 09:57:42白羊座
日期:2013-12-24 16:24:46辰龙
日期:2014-01-08 15:26:12技术图书徽章
日期:2014-01-17 13:24:40巳蛇
日期:2014-02-18 14:32:59未羊
日期:2014-02-20 14:12:13白羊座
日期:2014-02-26 12:06:59
6 [报告]
发表于 2015-09-11 17:50 |只看该作者
本帖最后由 jason680 于 2015-09-11 17:51 编辑

回复 5# caiwei_cs

ABS(Advanced Bash-Scripting)

Linux相关书籍(2015-07-10:更新ksh)
http://bbs.chinaunix.net/thread-1776727-1-1.html
   

论坛徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亚冠之浦和红钻
日期:2015-06-23 19:10:532015亚冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16赛季CBA联赛之山东
日期:2016-01-31 18:25:0515-16赛季CBA联赛之四川
日期:2016-02-16 16:08:30程序设计版块每日发帖之星
日期:2016-06-29 06:20:002017金鸡报晓
日期:2017-01-10 15:19:5615-16赛季CBA联赛之佛山
日期:2017-02-27 20:41:19
7 [报告]
发表于 2015-09-11 18:51 |只看该作者
在等你输入回车

论坛徽章:
0
8 [报告]
发表于 2015-09-14 09:12 |只看该作者
回复 7# waker


#是在等待回车么?


   

论坛徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亚冠之浦和红钻
日期:2015-06-23 19:10:532015亚冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16赛季CBA联赛之山东
日期:2016-01-31 18:25:0515-16赛季CBA联赛之四川
日期:2016-02-16 16:08:30程序设计版块每日发帖之星
日期:2016-06-29 06:20:002017金鸡报晓
日期:2017-01-10 15:19:5615-16赛季CBA联赛之佛山
日期:2017-02-27 20:41:19
9 [报告]
发表于 2015-09-14 13:26 |只看该作者
回复 8# caiwei_cs

!
echo $?
:
echo $?
echo $0


真的什么也没干?
如果你有bash,请用bash对比测试一下

   

论坛徽章:
0
10 [报告]
发表于 2015-09-15 10:51 |只看该作者
回复 9# waker


    试了,明白了,谢谢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP