annotate paste/paste.6763 @ 7910:7d5f1c5e44b1

<moon__> mkx bin/hfs//erro You have discovered an eerie caven. The air above the dark stone floor is alive with vorices of purple light and dark, boiling clouds. Seemingly bottomless glowing pit mark the surface.
author HackBot
date Sat, 07 May 2016 00:41:47 +0000
parents 84da026b16a5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1381
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
1 #!/bin/sh
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
2 cd /var/irclogs/_esoteric
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
3
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
4 pasterandom() {
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
5 if [ "$1" -gt 150 ]; then
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
6 echo "No."
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
7 exit
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
8 fi
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
9 for i in $(seq "$1"); do
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
10 file=$(shuf -en 1 ????-??-??.txt)
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
11 echo "$file:$(shuf -n 1 $file)"
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
12 done | paste
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
13 }
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
14
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
15 if [ "$1" ]; then
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
16 if expr "$1" + 0 >/dev/null 2>&1; then
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
17 pasterandom "$1"
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
18 else
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
19 lines=$(grep -P -i -- "$1" ????-??-??.txt | head -n 301)
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
20 {
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
21 echo "$lines" | head -n 300
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
22 [ $(echo "$lines" | wc -l) -eq 301 ] && echo "[too many lines; stopping]"
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
23 } | paste
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
24 fi
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
25 else
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
26 pasterandom 40
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
27 fi
84da026b16a5 <GreyKnight> cat bin/pastelog | paste
HackBot
parents:
diff changeset
28