wiki/运维/操作系统/Linux/脚本/判断上一条语句是否执行成功.sh
2025-01-02 10:46:09 +08:00

14 lines
145 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#/bin/bash
judgeOK(){
if [ $? -eq 0 ]
then
echo "success"
else
echo "fail"
fi
}
apt install asdxzcf
judgeOK