cURL / Mailing Lists / curl-library / Single Mail


wc test in c7b6e43e fails on sysv

From: Tor Arntsen <>
Date: Wed, 30 Jan 2013 10:07:59 +0100

The test for the existence of 'wc' fails on at least IRIX and Solaris:

+xc_tst_str='unknown unknown unknown unknown'
+xc_tst_str=`echo "$xc_tst_str" 2>/dev/null \
+ | wc -w 2>/dev/null`
+case "x$xc_tst_str" in @%:@ ((
+ x4)
+ :
+ ;;
+ *)
+ echo "$xc_msg_err 'wc' utility not found in 'PATH'. $xc_msg_abrt" >&2
+ exit 1
+ ;;

This is because on those architectures 'wc' outputs the number(s) with
leading zeros, consider:

$ echo "h h h h"|wc -w

IRIX, Solaris:
$ echo "h h h h"|wc -w

So the check for 'x4' will fail as the string is actually 'x 4'

Not certain what would be the least clumsy way of fixing it.. short of
removing the test, as I don't know any *nix variant which doesn't have
a 'wc' in the most basic PATH.


This e-mail and any attachment contain KONGSBERG information which may be
proprietary, confidential or subject to export regulations, and is only meant
for the intended recipient(s). Any disclosure, copying, distribution or use is
prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in
error, please delete it immediately from your system and notify the sender

List admin:
Received on 2013-01-30