Mercurial > repo
view paste/paste.6763 @ 3900:b1b0dcb5ad5e
<fizzie> printf \'%s\\n\' \'#!/usr/bin/env python\' \'import sys\' \'import unicodedata\' \'print u" ".join("[U+{0:04x} {1}]".format(ord(c), unicodedata.name(c, "DUNNO")) for c in " ".join(sys.argv[1:]).decode("utf-8")).encode("utf-8")\' > bin/unidecode
author | HackBot |
---|---|
date | Fri, 11 Oct 2013 13:57:18 +0000 |
parents | 84da026b16a5 |
children |
line wrap: on
line source
#!/bin/sh cd /var/irclogs/_esoteric pasterandom() { if [ "$1" -gt 150 ]; then echo "No." exit fi for i in $(seq "$1"); do file=$(shuf -en 1 ????-??-??.txt) echo "$file:$(shuf -n 1 $file)" done | paste } if [ "$1" ]; then if expr "$1" + 0 >/dev/null 2>&1; then pasterandom "$1" else lines=$(grep -P -i -- "$1" ????-??-??.txt | head -n 301) { echo "$lines" | head -n 300 [ $(echo "$lines" | wc -l) -eq 301 ] && echo "[too many lines; stopping]" } | paste fi else pasterandom 40 fi