*-Marcus Brinkmann <[EMAIL PROTECTED]>
|
| I need something that returns an error code if the directory is empty but
| does return 0 if it is non-empty.

I don't know how portable this is, but this seems to work for
me in bash:

test -d empty -a $(ls -l empty | wc -l) -eq 1

This returns 0 if "empty" is a dir and it is empty.

-- 
A mathematician is a machine for converting coffee to theorems
                                        (Erd\H{o}s P&aacute;l)
[EMAIL PROTECTED]   [-: .elOle. :-]   [EMAIL PROTECTED]

Reply via email to