亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 1531 | 回復(fù): 2
打印 上一主題 下一主題

[數(shù)值計算] if [ $a = "123" ] 與 if [ $a == "123 ] [復(fù)制鏈接]

論壇徽章:
4
丑牛
日期:2014-01-11 15:11:12亥豬
日期:2014-12-15 22:19:092015年辭舊歲徽章
日期:2015-03-03 16:54:152015年亞洲杯之約旦
日期:2015-03-13 19:45:11
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2016-08-01 21:41 |只看該作者 |倒序瀏覽
在有些書中說字符串判斷相等用=,如if [ $a = "123" ],我在linux上用==,如:if [ $a == "123 ]依然可以正確運行,請問這是bash的新特性嗎?
bash 版本4.2

論壇徽章:
145
技術(shù)圖書徽章
日期: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技術(shù)圖書徽章
日期: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 [報告]
發(fā)表于 2016-08-01 21:46 |只看該作者
回復(fù) 1# 魔鬼的驚嘆

$ man bash
NAME
       bash - GNU Bourne-Again SHell
...
CONDITIONAL EXPRESSIONS
       Conditional expressions are used by the [[  compound  command  and  the
       test  and [ builtin commands to test file attributes and perform string
       and arithmetic comparisons.  Expressions are formed from the  following
       unary  or  binary  primaries.   If any file argument to one of the pri‐
       maries is of the form /dev/fd/n, then file descriptor n is checked.  If
       the  file  argument  to  one  of  the  primaries  is one of /dev/stdin,
       /dev/stdout, or /dev/stderr, file descriptor 0, 1, or 2,  respectively,
       is checked.
...

       string1 == string2
       string1 = string2
              True  if  the strings are equal.  = should be used with the test
              command for POSIX conformance.

       string1 != string2
              True if the strings are not equal.


   

論壇徽章:
4
丑牛
日期:2014-01-11 15:11:12亥豬
日期:2014-12-15 22:19:092015年辭舊歲徽章
日期:2015-03-03 16:54:152015年亞洲杯之約旦
日期:2015-03-13 19:45:11
3 [報告]
發(fā)表于 2016-08-02 10:30 |只看該作者
回復(fù) 2# jason680
用了linux很長時間,貌似好像還沒有好好看過man bash,而且我還發(fā)現(xiàn)了一些新的特性,看的書貌似都有些老了
多謝多謝


   
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP