在shell script執行某程式之後判斷是否成功

sh /etc/init.d/rcS
if [ $? -ne 0 ]; then
    /sbin/check 1;

fi

$? is the exit status of the most recently-executed command; by convention, 0 means success and anything else indicates failure.

留言

這個網誌中的熱門文章

在嵌入式linux系統中使用android adbd,PC可直接透過USB對console下指令

lighttpd + fcgi + C language to do file upload & download

linux fuse-exfat於嵌入式系統的設定