From 693d9a3b5a05ada9c206db8459959236dd5262df Mon Sep 17 00:00:00 2001 From: Penny Leach Date: Tue, 15 Sep 2009 10:41:50 +0200 Subject: [PATCH] added bin/p (paste script) --- bin/p | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 bin/p 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 -- 2.39.5