On Sun, Jun 12, 2005 at 04:17:53PM +0200, Herve Seignole wrote:
> if [ `wc -l -n foo.txt` = 1 ]
> then
> echo "here"
> fi
Are these options really necessary? Why not just use this?
# use '-eq' test for numeric equality, since '=' compares strings.
if [ $(wc -l < foo.txt) -eq 1 ] ; then
echo here
fi
Regards,
James.