annotate bin/paste @ 7094:4a2788609dc2

<b_jonas> learn Elendil decided to try to save Numenor from its awful end by navigating to the undying lands and appealing to the Valar, but then he changed his mind, saved his family only and founded a new empire in Middle-earth.
author HackBot
date Sat, 05 Mar 2016 22:07:12 +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