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



Reply via email to