Open huaqianlee opened 3 years ago
http://huaqianlee.github.io/2020/11/09/Linux/Consolidating-the-foundation-of-Linux-useful-shell-script/
Last cmd is successfull or not12345678910function last_cmd_status()if [ $? -eq 0 ] # Space at out of '[]'then echo "success"elif [ $? -eq 1 ]then echo "failed,code is 1&
http://huaqianlee.github.io/2020/11/09/Linux/Consolidating-the-foundation-of-Linux-useful-shell-script/
Last cmd is successfull or not12345678910function last_cmd_status()if [ $? -eq 0 ] # Space at out of '[]'then echo "success"elif [ $? -eq 1 ]then echo "failed,code is 1&