Evolving the Satay Method of Flash Movies for Syndication Mozilla SeaMonkey 1.1.4 Package
Oct 04

This is a real quick one. I noticed uuidgen under linux produces lower case strings, while it’s Mac OS X counterpart produces uppercase strings. I generate UUID’s for the certificate CN field in Puppet, so I wanted them to match.

This one-liner did the trick nicely.

uuidgen | ruby -pe '$_.upcase!'

One Response to “Quick Ruby Upcase Filter”

  1. Clay Caviness Says:

    The old-time UNIX geek in me doesn’t like calling ruby when a much more lightweight solution has been around for ages: tr.

    $ uuidgen | tr a-z A-Z
    will do what you’re looking for with a bit fewer resources used (not that you’ll actually notice on a modern box).

    (It turns out you actually want ‘tr “[:lower:]” “[:upper:]“‘ to be a nice member of the global community and deal with locales properly, but that’s a lot of extra typing.)

Leave a Reply