diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-19 19:52:18 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-19 19:52:18 +0200 |
commit | 64b726770a07a0e04bcec3cf8ab23af4bcc2332f (patch) | |
tree | a2d2b4fb14895486c04262da022d4bdea7acd7d6 /pq4ps | |
parent | 41b2d257c71f654dd2fd9921d1f75f44b97a6592 (diff) | |
parent | 6dc632a155db800997e0eb2dec420a6233a2d141 (diff) | |
download | ponysay-64b726770a07a0e04bcec3cf8ab23af4bcc2332f.tar.gz ponysay-64b726770a07a0e04bcec3cf8ab23af4bcc2332f.tar.bz2 ponysay-64b726770a07a0e04bcec3cf8ab23af4bcc2332f.zip |
merge conflict resolved
Diffstat (limited to 'pq4ps')
-rwxr-xr-x | pq4ps | 39 |
1 files changed, 0 insertions, 39 deletions
@@ -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 |