[holy ruby programmers batman!] Stupid string tricks

Avdi Grimm avdi at avdi.org
Fri Dec 21 22:39:03 EST 2007

It's basically a way to pipe the Ruby world out to the Unix world and
then back again, in case there's something useful out there.   I think
the reason I originally created it was because for some reason I
wanted to use GNU grep on some strings.

Let's see if I can think of some other examples...

# mail the output of a command to myself
some_command | 'mail -c "Command Output" avd at avdi.org'

# my XML is messy, and I'm too lazy to gem install tidy
messy_xml | 'tidy'

# notify me when my object is destroyed (on a Mac)
ObjectSpace.define_finalizer(my_obj, proc { "Goodbye cruel world!" |
'growlnotify' })

That's all I can think of with a martini in me.  Maybe others can
think of more useful ways to use it.

Or maybe it's just a stupid string trick ;-)

More information about the Utilitybelt-tinkering mailing list