----- Original Message -----
>
> A more robust, (and more portable), formulation may be:
>
> echo $var | grep '^+\{0,1\}[0-9]\{1,\}$' > /dev/null 2>&1
Why fork, when straight shell will do?
case $var in
+*) tmp=$var ;;
*) tmp=+$var ;;
esac
case $tmp in
+*[!0-9]* | +) echo "not numeric" ;;
*) echo integer ;;
esac
Again, when placing this in autoconf.ac, you need to quote the
[0-9] since m4 eats one level of [], either by writing [[0-9]]
in place, or by using [] around the entire case snippet.
--
Eric Blake [email protected] +1-919-301-3266
Libvirt virtualization library http://libvirt.org
_______________________________________________
Autoconf mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/autoconf