From 88baa565a0be9f623d0aa52c0d3148c234b51516 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 18 Aug 2012 18:24:00 +0200 Subject: ponyquotes support --- pq4ps | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100755 pq4ps (limited to 'pq4ps') diff --git a/pq4ps b/pq4ps deleted file mode 100755 index 576a4e8..0000000 --- a/pq4ps +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -INSTALLDIR="$(dirname "$(dirname "$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )")")" # Get main bash script directory's parent - -if [ $# == 1 ] && ([ "$1" == '-l' ] || [ "$1" == '--list' ]); then - perl "$0.pl" "$INSTALLDIR" | cut -d @ -f 1 | uniq -else - _ponies="$(perl "$0.pl" "$INSTALLDIR")" - ponies=() - - if (( $# > 0 )); then - p=() - for arg in "$@"; do - p+="$(echo "$_ponies" | grep "^$arg@") " - done - _ponies=$p - fi - - ponies=( $_ponies ) - - if (( ${#ponies[@]} == 0 )); then - ponies=() - for arg in "$@"; do - ponies+=( "$arg" ) - done - - p="${ponies[$RANDOM%${#ponies[@]}]}" - q='I am totally speechless' - echo "-f" $p $q - else - pony="${ponies[$RANDOM%${#ponies[@]}]}" - - p="$(echo $pony | cut -d '@' -f 1)" - f="$(echo $pony | cut -d '@' -f 2)" - q="$(cat "$INSTALLDIR/share/ponysay/quotes/$f")" - - echo "-f" $p $q - fi -fi -- cgit