in reply to Newby question

Hello Parmenides,

Since this is a learning exercise, here are a couple of points to add to the excellent advice given by CountZero above:

By the way, CountZero’s advice about double-quoting variables is explained in What's wrong with always quoting "$vars"?.

(Also, please have a look at How do I compose an effective node title?.)

HTH,

Athanasius <°(((><contra mundum