diff options
author | Sven-Hendrik Haase <sh@lutzhaase.com> | 2012-02-26 16:47:05 +0100 |
---|---|---|
committer | Sven-Hendrik Haase <sh@lutzhaase.com> | 2012-02-26 16:47:05 +0100 |
commit | dacb16c8f8c0e83744e8bca79ff9fe33cb29c79e (patch) | |
tree | fa5dc03bccabee20d10a2bbbc22159c80a2e3e84 | |
parent | 3c5f2adc168f726c506270694983f9dbc1bde535 (diff) | |
download | ponysay-dacb16c8f8c0e83744e8bca79ff9fe33cb29c79e.tar.gz ponysay-dacb16c8f8c0e83744e8bca79ff9fe33cb29c79e.tar.bz2 ponysay-dacb16c8f8c0e83744e8bca79ff9fe33cb29c79e.zip |
Adding script
-rwxr-xr-x | ponysay | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -0,0 +1,24 @@ +#!/bin/bash +export PERL_UNICODE=S +ponydir=$PWD/ponies + +function ponyf() { + if [[ -f ${ponydir}/${1}.cow ]] ; then + cowsay -f "${ponydir}/${1}.cow" $@ + else + ponyr + fi +} +function ponyr() { + cowsay -f $(ls ${ponydir}/*.cow | sort -R | head -n1) $@ +} + +while getopts f:hv OPT +do + case ${OPT} in + v) echo "v0.01" ; exit;; + h) echo "helpherpderp" ; exit;; + f) ponyf ${2}; exit;; + \?) show_error "DERP"; exit;; + esac +done |