annotate paste.1 @ 4593:1f40eeeac13c

<oerjan> chmod +x paste.1
author HackBot
date Sun, 20 Apr 2014 00:45:00 +0000
parents 2c4e7296fa00
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4592
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
1 #!/bin/bash
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
2 if [ "$1" ] && url "$1" 2>/dev/null # Save making a file when it already exists.
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
3 then
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
4 else
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
5 PASTENUM="$RANDOM"
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
6
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
7 mkdir -p $HACKENV/paste
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
8
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
9 url paste/paste."$PASTENUM"
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
10 cat -- "${1--}" > $HACKENV/paste/paste."$PASTENUM"
2c4e7296fa00 <oerjan> fetch http://oerjan.nvg.org/paste
HackBot
parents:
diff changeset
11 fi