annotate bin/paste @ 9273:4d88066c879e

<shachaf> ` mkx \'bin/Binary//echo "$@"\'; mkx \'bin/binary//Binary file bin/binary matches\'
author HackBot
date Thu, 13 Oct 2016 22:56:42 +0000
parents 56dcce63901b
children 916b38c83c3b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5643
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
1 #!/bin/bash
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
2 if [ "$1" ] && url "$1" 2>/dev/null # Save making a file when it already exists.
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
3 then
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
4 true
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
5 else
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
6 PASTENUM="$RANDOM"
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
7
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
8 mkdir -p $HACKENV/paste
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
9
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
10 url paste/paste."$PASTENUM"
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
11 cat -- "${1--}" > $HACKENV/paste/paste."$PASTENUM"
56dcce63901b <tswett> revert
HackBot
parents:
diff changeset
12 fi