Codice PHP:
#!/bin/bash
NUM=`wc -l foo.txt | awk {'print $1'}`
if [ 
"$NUM-eq 0 ]; then
    
echo " Il documento è vuoto"
else
    echo 
" il documento contiene $NUM righe"
fi