📜  bash 测试空目录 - C++ 代码示例

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

代码示例1
#!/bin/bash

DIR="/empty_dir"

# look for empty dir 
if [ "$(ls -A $DIR)" ]; then
     echo "Take action $DIR is not Empty"
else
    echo "$DIR is Empty"
fi