#!/bin/sh # IsDirectoryEmpty.sh # 2008-01-29 # Chieh Cheng # http://www.CynosureX.com/ # GNU General Public License (GPL) Version 2, June 1991 scriptName=`echo $0 | sed s/\\\\/.*\\\\///g` if [ $# -ne 1 ] then echo " Usage: $scriptName \"directory\"" else dir="$1" result=`ls "${dir}" 2>&1` if [ "${result}" = "" ] then echo 1 else echo 0 fi fi