SH Periksa apakah direktori kosong
#!/bin/bash
DIR="/tmp"
if [ "$(ls -A $DIR)" ]; then
echo "Wow, $DIR is not Empty"
else
echo "$DIR is Empty"
fi
Wrong Willet
#!/bin/bash
DIR="/tmp"
if [ "$(ls -A $DIR)" ]; then
echo "Wow, $DIR is not Empty"
else
echo "$DIR is Empty"
fi