Paul Calnan
Published January 27, 2013

Here's a dead simple TextExpander snippet that I use quite a bit.

#!/usr/bin/env bash
pbpaste | %fill:filter%

Be sure to set the Content to Shell Script. I have this set to fire when I type ;pipe.

When it fires, a dialog is presented allowing you to fill in whatever you want where the %fill:filter% appears. It takes the contents of the pasteboard and runs it through an arbitrary Unix pipeline. You can enter a single command, (like tr a-z A-Z) or a pipeline of commands (like sort | uniq -c). The contents of the pasteboard are passed through whatever set of commands you specify and the result is substituted to wherever you were typing.