欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費電子書(shū)等14項超值服

開(kāi)通VIP
shell入門(mén)基礎(3)

(2)整數操作符具有和字符操作符類(lèi)似的功能.只是他們的操作是針對整數

 test表達式  |  含義
  ---------------------------------------------
  Int1 -eq int2|當int1等于int2時(shí),返回True
  Int1 -ge int2|當int1大于/等于int2時(shí),返回True
  Int1 -le int2|當int1小于/等于int2時(shí),返回True
  Int1 -gt int2|當int1大于int2時(shí),返回True
  Int1 -ne int2|當int1不等于int2時(shí),返回True
  -----------------------------------------

(3)用于文件操作的操作符,他們能檢查:文件是否存在,文件類(lèi)型等

 test表達式  |  含義
  ------------------------------------------------
  -d file   |當file是一個(gè)目錄時(shí),返回 True
  -f file   |當file是一個(gè)普通文件時(shí),返回 True
  -r file   |當file是一個(gè)刻讀文件時(shí),返回 True
  -s file   |當file文件長(cháng)度大于0時(shí),返回 True
  -w file   |當file是一個(gè)可寫(xiě)文件時(shí),返回 True
  -x file   |當file是一個(gè)可執行文件時(shí),返回 True
  ------------------------------------------------

(4)shell的邏輯操作符用于修飾/連接包含整數,字符串,文件操作符的表達式

 test表達式  |  含義
  ----------------------------------------------------------
  ! expr    |當expr的值是False時(shí),返回True
  Expr1 -a expr2|當expr1,expr2值同為T(mén)rue時(shí),返回True
  Expr1 -o expr2|當expr1,expr2的值至少有一個(gè)為T(mén)rue時(shí),返回True
  -----------------------------------------------------------

注意:

tcsh shell 不使用test命令,但是tcsh中的表達式同樣能承擔相同的功能.tcsh

支持的表達式于C中的表達式相同.通常使用在if和while命令中.

 tcsh表達式  |  含義
  -------------------------------------------------------
  Int1 <= int2 |當int1小于/等于int2時(shí),返回True
  Int1 >= int2 |當int1大于/等于int2時(shí),返回True
  Int1 < int2  |當int1小于int2時(shí),返回True
  Int1 > int2  |當int1大于int2時(shí),返回True
  Str1 == str2 |當str1與str2相同時(shí),返回True
  Str1 != str2 |當str1與str2不同時(shí),返回True
  -r file    |當file是一個(gè)可讀文件時(shí),返回True
  -w file    |當file是一個(gè)可寫(xiě)文件時(shí),返回True
  -x file    |當file是一個(gè)可執行文件時(shí),返回True
  -e file    |當file存在時(shí),返回True
  -o file    |當file文件的所有者是當前用戶(hù)時(shí),返回True
  -z file    |當file長(cháng)度為0時(shí),返回True
  -f file    |當file是一個(gè)普通文件時(shí),返回True
  -d file    |當file是一個(gè)目錄時(shí),返回True
  Exp1 || exp2 |當exp1和exp2的值至少一個(gè)為T(mén)rue時(shí),返回True
  Exp1 && exp2 |當exp1和exp2的值同為T(mén)rue時(shí),返回True
  ! exp     |當exp的值為False時(shí),返回True
  -------------------------------------------------------

5.條件語(yǔ)句

同其他高級語(yǔ)言程序一樣,復雜的shell程序中經(jīng)常使用到分支和循環(huán)控制結構,

bash,pdksh和tcsh分別都有兩種不同形式的條件語(yǔ)句:if語(yǔ)句和case語(yǔ)句.

(1)if語(yǔ)句

語(yǔ)法格式:

bash/pdksh用法:

if [expression1]

then

commands1

elif [expression2]

commands2

else

commands3

if

tcsh用法:

if (expression1) then
commands1
else if (expression2) then
commands2
else
commands3
endif

含義:當expression1的條件為T(mén)rue時(shí),shell執行then后面的commands1命令;當

expression1的條件為false并且expression2的條件滿(mǎn)足為T(mén)rue時(shí),shell執行

commands2命令;當expression1和expressin2的條件值同為false時(shí),shell執行

commands3命令.if語(yǔ)句以他的反寫(xiě)fi結尾.

本站僅提供存儲服務(wù),所有內容均由用戶(hù)發(fā)布,如發(fā)現有害或侵權內容,請點(diǎn)擊舉報。
打開(kāi)APP,閱讀全文并永久保存 查看更多類(lèi)似文章
猜你喜歡
類(lèi)似文章
shell程序設計
Shell 基本運算符 | 菜鳥(niǎo)教程
Linux Shell編程參考大全
常用語(yǔ)法 -b file -c file -f file-d file -x file
Shell 條件判斷總結
用shell的expr表達式作計算器
更多類(lèi)似文章 >>
生活服務(wù)
分享 收藏 導長(cháng)圖 關(guān)注 下載文章
綁定賬號成功
后續可登錄賬號暢享VIP特權!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服

欧美性猛交XXXX免费看蜜桃,成人网18免费韩国,亚洲国产成人精品区综合,欧美日韩一区二区三区高清不卡,亚洲综合一区二区精品久久