#!/bash/bash
test=$(env |grep "USER" |cut -d "=" 2)
if("$test == "root")
then
echo "current user is root!"
fi
test=$(env |grep "USER" |cut -d "=" 2)
if("$test == "root")
then
echo "current user is root!"
fi
2015-08-02
if [ -n "$num1" -a -n "$num2" -a -n "$op" ]
shell編程類似的這種對于變量的判斷一定要記得加雙引號,雖然有時候顯得沒必要,但是在程序比較大時可能會因為這種小細節出錯,這種問題應該調試半天也不一定能發現
shell編程類似的這種對于變量的判斷一定要記得加雙引號,雖然有時候顯得沒必要,但是在程序比較大時可能會因為這種小細節出錯,這種問題應該調試半天也不一定能發現
2015-07-23