目前分類:Shell Script (3)
- Jul 08 Fri 2011 16:46
Shell Script : if 條件式
- Jul 08 Fri 2011 16:46
Shell Script : case 條件式
case 敘述和if 的功能類似,其基本語法如下
case $VARIABLE in value_1 ) ... ;; value_2 ) ... ;; value_3 ) ... ;; esac
其中;; 代表break的功能
- Jul 08 Fri 2011 16:43
Shell Script : Debug and trace
script 是一種直譯式語言,無法透過事先編譯來知道語法上錯誤所在,所以在debug 方面並不是那麼的方便,不過bash 還是有提供相關參數來進行一些簡單的判斷
# sh [-nvx] script.sh