How do I tell when a directory is empty in a script?

Paul Barton-Davis pauld at stowe.cs.washington.edu
Tue Apr 16 04:05:50 AEST 1991


In article <900 at homer.UUCP> root at homer.ORG (Marc Brumlik) writes:

>it can be even easier than this...  how about:
 [ deleted ]

why not just:

	if [ "`cd $1 ; echo *`" ] ; then
	   echo "not empty"
	else
	   echo "empty"
	fi



-- 
Paul Barton-Davis			<pauld at cs.washington.edu>
UW Computer Science Lab		``to shatter tradition makes us feel free''



More information about the Comp.unix.questions mailing list