2009/07/15

Shell script 練習

if [ $# -eq 1 ]; then
CHKPATH=/var/run/$1.pid
if [ -e $CHKPATH ]; then
echo "service is up"
PID=`cat $CHKPATH`
echo "pid = $PID"
else
echo "service is down"
fi
else
echo "arg error"
fi

PHP 寫過頭,變數名稱前面都會很順手的加上「$」,連指定的時候都不例外... Orz

沒有留言:

張貼留言