|
| From: | Marc Herbert |
| Subject: | Re: best way to test for empty dir? |
| Date: | Fri, 11 Dec 2009 16:16:13 +0000 |
| User-agent: | Thunderbird 2.0.0.21 (X11/20090320) |
Sven Mascheck a écrit :
> Chris F.A. Johnson wrote:
>
>> This has been discussed more than once in c.u.s; check the
>> archives.
>
> and that's why we better discuss it here now?
I think Chris' message was more like: "let's not discuss it at all and
just read the archives" :-]
In case anyone is interested my winner (so far) is:
exists()
{
[ -e "$1" -o -L "$1" ]
}
if exists foo/*; then
for f in foo/*; do
...
done
fi
| [Prev in Thread] | Current Thread | [Next in Thread] |