I do so much with Perl one-liners, I sometimes miss out on what my shell can do. I just learned about $RANDOM this morning! If I had needed to Generate a MAC address, I think I would have written
perl -E 'say join ":", map {sprintf "%02X", rand 256} 1..6'and never investigated what bash can do.
Meh, the perl code is cleaner, shorter, and easier to read, but I do concur that $RANDOM is a nifty utility (that I also did not know about).
Posted by: Hurdlecrew | 02/20/2011 at 08:03 PM