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

  免費注冊 查看新帖 |

Chinaunix

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

test 與 [[ ]] , 這個[[ ]] 該怎么理解? [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2007-12-03 09:22 |只看該作者 |倒序瀏覽
比如以前用:

if [ "$answer" = yes ]

這里的 "[" 是等同于test 命令的,不過多了個表示結(jié)束的 "]"


現(xiàn)在可以用:

if [[ $answer = yes ]]

那么這里的兩個 "[" 該怎么理解?

論壇徽章:
8
摩羯座
日期:2014-11-26 18:59:452015亞冠之浦和紅鉆
日期:2015-06-23 19:10:532015亞冠之西悉尼流浪者
日期:2015-08-21 08:40:5815-16賽季CBA聯(lián)賽之山東
日期:2016-01-31 18:25:0515-16賽季CBA聯(lián)賽之四川
日期:2016-02-16 16:08:30程序設(shè)計版塊每日發(fā)帖之星
日期:2016-06-29 06:20:002017金雞報曉
日期:2017-01-10 15:19:5615-16賽季CBA聯(lián)賽之佛山
日期:2017-02-27 20:41:19
2 [報告]
發(fā)表于 2007-12-03 09:28 |只看該作者

  1.      [[ expression ]]
  2.               Return a status of 0 or 1 depending on the  evaluation  of  the
  3.               conditional expression expression.  Expressions are composed of
  4.               the primaries described below  under  CONDITIONAL  EXPRESSIONS.
  5.               Word  splitting and pathname expansion are not performed on the
  6.               words between the [[ and ]];  tilde  expansion,  parameter  and
  7.               variable expansion, arithmetic expansion, command substitution,
  8.               process substitution, and quote removal are performed.   Condi-
  9.               tional  operators  such as -f must be unquoted to be recognized
  10.               as primaries.
復(fù)制代碼

論壇徽章:
0
3 [報告]
發(fā)表于 2007-12-03 09:29 |只看該作者

論壇徽章:
0
4 [報告]
發(fā)表于 2007-12-03 11:28 |只看該作者

回復(fù) 2樓 3樓

謝謝樓上兩位,還是我不夠仔細。
原來 [[ 是關(guān)鍵字。
另外想問一下:在調(diào)用的時候,關(guān)鍵字和內(nèi)置命令之間有什么區(qū)別?(或者關(guān)鍵字也是內(nèi)置命令的一種?)
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(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