Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uwm.edu!rpi!batcomputer!cornell!uw-beaver!cs.washington.edu!pauld From: pauld@cs.washington.edu (Paul Barton-Davis) Newsgroups: comp.unix.questions Subject: testing if a directory is empty (OOOPS!) Message-ID: <1991Apr15.195513.17840@beaver.cs.washington.edu> Date: 15 Apr 91 19:55:13 GMT Sender: news@beaver.cs.washington.edu (USENET News System) Reply-To: pauld@cs.washington.edu (Paul Barton-Davis) Organization: Computer Science & Engineering, U. of Washington, Seattle Lines: 20 Originator: pauld@stowe.cs.washington.edu Oops - correction to previous posting i didn't bother to check the logic of the echo, i just shortened the syntax. in fact, the whole idea is broken: $ mkdir x $ cd x $ files=`echo *` $ echo $files * So it needs to be: [ "`cd $1 ; echo .??* *`" = ".??* *" ] this picks up a dot files too (anyone who has a dot file called ".a" should be taken out and shot :-) -- Paul Barton-Davis UW Computer Science Lab ``to shatter tradition makes us feel free''