From dacb16c8f8c0e83744e8bca79ff9fe33cb29c79e Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sun, 26 Feb 2012 16:47:05 +0100 Subject: Adding script --- ponysay | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 ponysay diff --git a/ponysay b/ponysay new file mode 100755 index 0000000..71efa38 --- /dev/null +++ b/ponysay @@ -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 -- cgit