[Gloucs] shell script
Will Roe
gloucs at mailman.lug.org.uk
Thu Dec 19 23:25:00 2002
--wq9mPyueHGvFACwf
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hi,
On Thu, Dec 19, 2002 at 11:03:34PM +0000 or thereabouts, Guy Edwards wrote:
> Hi,
>=20
> I've got the following shell script I've cobbled together, it's not
> working though.
>=20
> I want to open and close a program a number of times (I've used ls as an
> example here but it's a bigger program)
>=20
> -----------------
>=20
> #!/bin/bash
>=20
> opens=3D"0" // set the value of opens to 0
opens=3D0
>=20
> echo "Starting run"
>=20
> while ($opens < 5); do // while opens is less than 5 do....
while [ $opens -lt 5 ] ; do
> ls // command name
> $$=3D$current // store its process ID
current=3D$$
> sleep 10 // give program time to finish starting
> kill $current // kill the process=20
> opens=3D$opens+1 // add one to the number of opens
that should be opens=3D$(($opens+1))
> echo "\nOpened program $opens times" // give feedback
> done
>=20
> return 0
If that doesn't work, I'll eat my cat...oh sorry...hat ;)
Will
>=20
> -------------
>=20
> Could anyone point me in roughly the right direction?
>=20
> Guy
>=20
>=20
>=20
> _______________________________________________
> gloucs mailing list
> gloucs@mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/gloucs
--=20
Some people have parts that are so private they themselves have no
knowledge of them.
--wq9mPyueHGvFACwf
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+AlTjnDChyePHZXkRAlNqAJ9Vo+QzBUPg6qLM4vG4gQ6/E60iAACggThV
m9hK4MjtSidXtuD8gH2LV5k=
=WJhT
-----END PGP SIGNATURE-----
--wq9mPyueHGvFACwf--