How to use pastebin from shell script?

litro picture litro · Oct 25, 2010 · Viewed 20.5k times · Source

Is it possible to use pastebin (may be via their "API" functionality) inside bash shell scripts? How do I send http-post? How do I get back the URL?

Answer

user2291758 picture user2291758 · Jun 10, 2014

As pastebin.com closed their public api, I was looking for alternatives.

Sprunge is great. Usage:

<command> | curl -F 'sprunge=<-' http://sprunge.us

or, as I use it:

alias paste="curl -F 'sprunge=<-' http://sprunge.us"
<command> | paste