Dear
Don Cragun,
I feel like a fool.
I did not know about the
% operator. I have various scripts generating low random numbers (password generators mainly) that have a variation of my poor attempt above that would be so much neater with your suggestion, and easier to document too.
Thanks for this nugget, I will store it away for future use.
Robin