pastebin - collaborative debugging tool
kpaste.net RSS


kpaste submit bash script
Posted by Anonymous on Tue 19th Jul 2011 13:28
raw | new post

  1. #!/bin/bash
  2.  
  3. if [ $# -ne 1 ]; then
  4.         echo "Usage: $0 filename"
  5.         exit 1
  6. fi
  7.  
  8. if [ ! -f "$1" ]; then
  9.         echo "File $1 does not exist."
  10.         exit 1
  11. fi
  12.  
  13. TMPFILE=$(tempfile)
  14. #echo "Temp File: $TMPFILE"
  15. curl -s -c $TMPFILE -H Expect: -d username=<USER> -d password=<PASS> http://kpaste.net/login
  16.  
  17. curl -s -D- -b $TMPFILE -H Expect: --data-urlencode code2@$1 -d paste=Send -d private=no -d expiry=d -d format=text http://kpaste.net  | grep Location: | awk '{print "http://kpaste.net" $2}'
  18.  
  19. rm -f $TMPFILE

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at