shell学习

1.$?

取最近一次命令执行后的退出状态

执行成功,返回码为0

执行失败,返回码为1

#cd /root

#echo $?

0

原文地址:https://www.cnblogs.com/lianyg/p/10622799.html