5 #From: damercer@mmm.com (Dan Mercer)
6 #Newsgroups: comp.unix.admin,comp.unix.shell,comp.unix.programmer,comp.sys.sun.admin
7 #Subject: Re: Command to find out if a directory is empty
8 #Date: 17 Aug 2000 14:35:56 GMT
9 #Message-ID: <8ngt8c$fmr$1@magnum.mmm.com>
11 # usage: emptydir [dirname] ; default dirname is "."
15 typeset
file dir
=${1:-.}
17 echo "$FUNCNAME: $dir is not a directory" >&2
20 for file in $dir/.
* $dir/*
24 \
*) [[ -e $file ]];let $?
;return;;