DIR=your_dir [ ! -d ${DIR} ] && mkdir ${DIR} 解读 command1 && command2 只有command1返回为真(0)时command2才会执行 类似地还有 command1 || command2 只有command1返回为假(非0)command2才会执行