|
| From: | Antonio Macchi |
| Subject: | Re: best way to test for empty dir? |
| Date: | Fri, 11 Dec 2009 12:40:40 +0100 |
| User-agent: | Mozilla-Thunderbird 2.0.0.19 (X11/20090103) |
is_file()
{
[ -f "$1" ] && return
return 1
}
is_file /path/to/dir/* || echo empty
you don't need to check more than the first element
| [Prev in Thread] | Current Thread | [Next in Thread] |