bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I upgraded the wc tool


From: James Youngman
Subject: Re: I upgraded the wc tool
Date: Sun, 12 Jun 2005 17:50:11 +0100
User-agent: Mutt/1.3.28i

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]