[Gloucs] scripting

Steve Searle gloucs at mailman.lug.org.uk
Thu May 29 23:26:01 2003


--TRYliJ5NKNqkz5bu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Around 10:58pm on Thursday, May 29, 2003 (UK time), Richard Mellersh scrawl=
ed:

> Can anyone help?
>=20
> I'm still trying to sort out some old stuff that never worked on older=20
> systems.  There is something wrong with line 4 inside the [brackets] -=20
> expects a "unary operator".
>=20
> #! /bin/bash
> typeset -i num
> num=3Difconfig | grep eth1 | wc -l

I don't think this line is returning an integer.  After adding spaces
after/before the [s, I got the unary operator message.  Setting num to 0
removes the error message, and echoing num after it has been set
displays "<whitespace>0".

Cheers

Steve

--=20
=20
(o<     www.stevesearle.com
//\     Powered by Red Hat Linux
V_/_    No MS products were used in the creation of this message
=20
 11:22pm  up 1 day,  8:22,  2 users,  load average: 0.02, 0.03, 0.00

--TRYliJ5NKNqkz5bu
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+1ojYwPQBEouE4PkRAiXrAJ0VOwsVknp+wqbU5OsNZ+8zpXb45gCfT9cJ
bD/bBVBGZKv2sob49IE8bU8=
=0S+g
-----END PGP SIGNATURE-----

--TRYliJ5NKNqkz5bu--