From C

Jump to: navigation, search

This script seems to work well enough, if you have curl on your (modern UN*X-like) system.

## Paste a file to
test -f "$1" || { echo "usage: rafb file [lang [nick [desc]]]" >&2 && exit 1; }
curl -v "$site/paste/paste.php" \
                -F "lang=${2:-Plain Text}" \
                -F "nick=${3:-${IRCNICK:-anonymous}}" \
                -F "desc=${4:-$(basename "$1")}" \
                -F "cvt_tabs=No" \
                -F "text=<$1" \
                2>&1 >/dev/null |
        awk -vsite="$site" '/^< Location: /{if ($3~"^/")url=site$3;else url=$3}{print}END{print url}'

If you plan on pasting mostly C source code, you may want to change ${2:-Plain Text} to ${2:-C89} or ${2:-C99} instead.


You can use Smart Paste autopaste v1.0

Category IRC

Personal tools