From cad0e50f61e1e361dcc0e0625d4f19267cd4c7c1 Mon Sep 17 00:00:00 2001 From: VG Date: Fri, 28 Nov 2014 18:12:05 +0100 Subject: add a helper script for pasteme --- scripts/pasteme | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 scripts/pasteme diff --git a/scripts/pasteme b/scripts/pasteme new file mode 100755 index 0000000..a47fdc6 --- /dev/null +++ b/scripts/pasteme @@ -0,0 +1,18 @@ +#!/bin/bash + +file="$1" +tempfile="" + +rmtempfile_cb() { rm "$tempfile"; } + +if [ "$file" == "" ]; then + tempfile="$(mktemp)" + trap rmtempfile_cb EXIT + cat > $tempfile + file=$tempfile +fi + +file="${file/\\/\\\\}" +file="${file/\"/\\\"}" + +curl --form "content=<\"$file\"" http://paste.devys.org/ -- cgit v1.2.3