huaqianlee / huaqianlee.github.io

Good good study,day day up!
3 stars 0 forks source link

Consolidating the foundation of Linux, useful shell script | Andy.Lee's Blog #81

Open huaqianlee opened 3 years ago

huaqianlee commented 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&