📌  相关文章
📜  sh 检查目录是否为空 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:46.382000             🧑  作者: Mango

代码示例1
#!/bin/bash
DIR="/tmp"

if [ "$(ls -A $DIR)" ]; then
     echo "Wow, $DIR is not Empty"
else
    echo "$DIR is Empty"
fi