.sh & getopts
Matthew Seaman
m.seaman at infracaninophile.co.uk
Sun Jun 6 07:09:55 UTC 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 06/06/2010 02:47:38, Dan Nelson wrote:
>> flag_count=`expr $flag_count + 1`
> /bin/sh can do math on its own:
>
> flag_count=$((flag_count+1))
flag_count=$(( $flag_count + 1 ))
surely? Needs to dereference the variable inside the arithmetic expansion.
Cheers,
Matthew
- --
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matthew at infracaninophile.co.uk Kent, CT11 9PW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkwLSaIACgkQ8Mjk52CukIzQvQCfUnjDCkQ1Xk18MiENPTBhEKlA
PIgAnivZn/n+vJVXYFZnpOcrJ0/6voQV
=kZtj
-----END PGP SIGNATURE-----
More information about the freebsd-questions
mailing list