All pastes #1308570 Raw Edit

dpecka

public shellscript v1 · immutable
#1308570 ·published 2009-01-15 00:14 UTC
rendered paste body
#!/bin/bash## paste output of commands directly to pastebin.ca# regards by dpecka alias nettezzaumana## check for -h or --help optionif [ "$1" = "--help" ] || [ "$1" = "-h" ]; then        echo -e 'usage :: `foo | pastebin.sh [-f]`'; exit;fi## check for wget availability and if is able to upload files ..if test ! -x "$(which wget 2>/dev/null)"; then        echo "can't find executable wget .. it's over";        exit;fiif test -z "$(wget --help | grep 'post-file=')"; then    echo "seems like your wget can't upload files .. it's over";    exit;fiPASTEBINKEY="bU5WOzg358e+D6pSAHRvuTJj/YUhY+zk";PLINES="0";## build tempfile to upload ..echo "name=$USER&type=23&description=/tmp/pastebin.sh.tmpx&expiry=&s=Submit+Post&content=" > /tmp/pastebin.sh.tmpxwhile IFS= read -r line; do    echo "$line" >> /tmp/pastebin.sh.tmpx;    PLINES=$(($PLINES + 1));done