On 09/26/2012 05:20 PM, Alan DeKok wrote:
Brian Candler wrote:
radtest starts with /bin/sh, not /bin/bash. Are you sure this regexp-matching stuff is in a vanilla POSIX shell? I don't think it is.
Me either. FreeRADIUS runs on Linux, *BSD, Solaris, and (at one time) AIX and HPUX. Portability is good.
This bombs out if you give a non-numeric value, but then that's your fault for passing bad data. A more backwards-compatible approach is simply:
if [ "$6" != "" -a "$6" != "0" ]
That should work, I think.
Fine with me, I'm not wedded to any particular solution as long as it works. Although shouldn't the comparison to zero be performed with the integer operator -ne? In any event use whatever solution suits you. -- John Dennis <jdennis@redhat.com> Looking to carve out IT costs? www.redhat.com/carveoutcosts/