view bin/quote @ 5155:114ace0a7ea6

<shachaf> slashlearn identity function/The identity function is a mockingbird.
author HackBot
date Wed, 19 Nov 2014 10:34:38 +0000
parents 44d4b2e5140d
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 -n 1; fi