view test/quote @ 121:8a04b0258775

<elliott> run mv bin test; touch bin
author HackBot
date Thu, 22 Mar 2012 19:17:38 +0000
parents
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