diff options
author | VG <vg@devys.org> | 2014-11-28 18:12:05 +0100 |
---|---|---|
committer | VG <vg@devys.org> | 2014-11-28 18:12:05 +0100 |
commit | cad0e50f61e1e361dcc0e0625d4f19267cd4c7c1 (patch) | |
tree | 174e887fad4f11131dc892695a1a12c02861062e | |
parent | f74a985b3f3f05b7b05cef5b9c8be8d748498de5 (diff) | |
download | pasteme-cad0e50f61e1e361dcc0e0625d4f19267cd4c7c1.tar.gz pasteme-cad0e50f61e1e361dcc0e0625d4f19267cd4c7c1.tar.bz2 pasteme-cad0e50f61e1e361dcc0e0625d4f19267cd4c7c1.zip |
add a helper script for pasteme
-rwxr-xr-x | scripts/pasteme | 18 |
1 files changed, 18 insertions, 0 deletions
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/ |