Fast way to share text from commandline

If you want to share text you can do it with and then inside your .bash-aliases or similar define a function like


haste () {                                                                                                                              
        curl -X POST -s -d "$a" $HASTE_SERVER/documents | awk -F '"' -v haste_server=$HASTE_SERVER '{ print haste_server"/"$4 }'

If you want to share somefile from commandline with

cat somefile | haste

and it will respond with e.g

that points to the shared text from somefile. To get text down into a localfile again do

curl > somefile

and your have a local version of that file.

Notice that you should not share important information with this tool as it is not secure.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.