shell 中的 if-elif-else 注意點


1,比較符號不能用  > < =

而要用

大於 -gt (greater than)
小於 -lt (less than)
大於或等於 -ge (greater than or equal)
小於或等於 -le (less than or equal)
不相等 -ne (not equal)

2,else  后面是沒有then 的

3,if [ 'a' -gt 1 ];then  if后面的條件表達式要放在[] 中 並且兩邊要有空格。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM