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

Brian Fitzgerald fitz at mml0.meche.rpi.edu
Sun Mar 31 01:09:33 AEST 1991


Michael Harris writes:
>When I am running a shell script, how can I tell when a directory is empty?

Try:

	if [ ! "`ls -A $name`" ] ; then



More information about the Comp.unix.questions mailing list