Skip to content

Instantly share code, notes, and snippets.

@mthierry
Created May 11, 2017 21:54
Show Gist options
  • Save mthierry/3d448cf707b363ad54a7a878fcfdb678 to your computer and use it in GitHub Desktop.
Save mthierry/3d448cf707b363ad54a7a878fcfdb678 to your computer and use it in GitHub Desktop.
#!/bin/bash
result=$(curl -sf --data-binary @${1:--} https://hastebin.com/documents) || {
echo "ERROR: failed to post document" >&2
exit 1
}
key=$(jq -r .key <<< $result)
echo "https://hastebin.com/${key}"
@mthierry
Copy link
Author

sudo apt-get install jq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment