RSS

tumble.lukeredpath

Sep 19
Permalink

Using pastie from the command line

I was having some problems with the Ruby and Curl scripts on Pastie so I hacked together a quick script of my own. It takes the text you want to paste from STDIN and sends it to pastie (run pastie -h for options) and if successful it prints the resulting pastie URL.

Its easy to chain common unix commands together with the pastie script - try this to send the contents of a file to pastie then open the resulting paste in your default browser (OSX/*nix):


$ cat ~/somefile.html | pastie -f html | xargs open