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.


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to