view bin/quote @ 11974:b8ec57cc1216 draft

<b_jonas> `` hg cat -r 11938 share/whatis > share/whatis
author HackEso <hackeso@esolangs.org>
date Mon, 21 Oct 2019 21:54:49 +0000
parents 3e54f8d1843f
children
line wrap: on
line source

#!/bin/sh
allquotes | if [ "$1" ]; then
    if expr "$1" + 0 >/dev/null 2>&1; then
        sed "$1q;d"
    else
        grep -P -i -- "$1"
    fi
else shuf --random-source=/dev/urandom -n 1; fi