From: Penny Leach Date: Tue, 15 Sep 2009 08:41:50 +0000 (+0200) Subject: added bin/p (paste script) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=693d9a3b5a05ada9c206db8459959236dd5262df;p=scripts.git added bin/p (paste script) --- diff --git a/bin/p b/bin/p new file mode 100755 index 0000000..15b74de --- /dev/null +++ b/bin/p @@ -0,0 +1,28 @@ +#!/bin/zsh +# +# func/p +# +# function to publish to a pastebin (using pastebinit) +# +# Copyright © 1994–2008 martin f. krafft +# Released under the terms of the Artistic Licence 2.0 +# +# Source repository: git://git.madduck.net/etc/zsh.git +# + +if [[ $# -gt 1 ]]; then + echo E: only one argument can be passed. >&2 + exit 1 +fi + +PERMATAG=$USER +PB=http://slexy.org +PBIT="pastebinit -b $PB -a $USER" + +FILE=- +[[ -n "$1" ]] && FILE="$1" + +URL=`eval $PBIT -i $FILE` + +firefox $URL +print $URL