[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

best way to test for empty dir?

From: Marc Herbert
Subject: best way to test for empty dir?
Date: Thu, 10 Dec 2009 17:31:20 +0000
User-agent: Thunderbird (X11/20090320)


Does anyone know a more elegant way to check for file existence?
Something that does not fork a subshell. And is also more readable
maybe. And is obviously not much longer.

    test "x$(echo $1/*$2)" = "x$1"'/*'"$2"

Warning: I find neither "noglob" nor "ls" elegant, sorry!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]