Archive for October 4th, 2007

Quick Ruby Upcase Filter

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!'