On Wed, Feb 21, 2007 at 12:41:41PM +0000, MJ Ray wrote:
On Wed, Feb 21, 2007 at 11:42:10AM +0000, Eur Ing Chris Green wrote:
What's the simplest (and/or most concise) way to check for an empty directory?
Is it [ -d $dirname ] && [ $dirname/* == "$dirname/*" ] in Bourne shell?
ENOCIGAR
brettp@fudge:~$ if [ -d empty ] && [ empty/* == "empty/*" ]; then echo empty; fi empty brettp@fudge:~$ if [ -d .xmms ] && [ .xmms/* == ".xmms/*" ]; then echo empty; fi bash: [: too many arguments brettp@fudge:~$
Cheers,