On Thu, Mar 20, 2008 at 11:59 AM, Silviu Marin-Caea
<[EMAIL PROTECTED]> wrote:
> Cum pot sa testez daca exista vreun fisier intr-un director?
>
>  Stiti vreo metoda mai eleganta decat asta?
>  if [ "$(ls * 2>/dev/null)" = "" ]; then echo nimic; fi
>

[ `stat --printf='%h' $director` -gt 2 ] && echo "not empty" || echo empty

-- 
 "Unix was written to play Spacewar and cheat at Scrabble,
 but Linux was created merely to prove that it booted." - a.s.r. quote

_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug

Raspunde prin e-mail lui