aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2012-07-19 23:39:21 +0200
committerMattias Andrée <maandree@operamail.com>2012-07-19 23:39:21 +0200
commit4dbdca4e85e04fffad598df589fd2114ae267be5 (patch)
tree2e26e27beac6ad264a848c9d85aeca12e711ebef
parente12021971dd1eb20ba58c0aaf65412dba0c7d6ca (diff)
downloadponysay-4dbdca4e85e04fffad598df589fd2114ae267be5.tar.gz
ponysay-4dbdca4e85e04fffad598df589fd2114ae267be5.tar.bz2
ponysay-4dbdca4e85e04fffad598df589fd2114ae267be5.zip
adding support for customise cowsay with UCS use, but removing support for cowsay replacers not written in perl; I will provide a screenshot and an environment variable for this..
-rwxr-xr-xponysay6
1 files changed, 3 insertions, 3 deletions
diff --git a/ponysay b/ponysay
index d7fb068..bacf1eb 100755
--- a/ponysay
+++ b/ponysay
@@ -210,12 +210,12 @@ say() {
if [ "$TERM" = "linux" ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'yes' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = 'y' ] || [ "$PONYSAY_TRUNCATE_HEIGHT" = '1' ]; then
if [ "$PONYSAY_BOTTOM" = 'yes' ] || [ "$PONYSAY_BOTTOM" = 'y' ] || [ "$PONYSAY_BOTTOM" = '1' ]; then
- exec "$cmd" -f "$pony" "${wrap:+-W$wrap}" | wtrunc | htrunctail
+ perl <(cat <(echo -e '#!/usr/bin/perl\nuse utf8;') $(for c in $(echo $PATH":" | sed -e 's/:/\/'"$cmd"' /g'); do if [[ -f $c ]]; then echo $c; break; fi done)) -f "$pony" "${wrap:+-W$wrap}" | wtrunc | htrunctail
else
- exec "$cmd" -f "$pony" "${wrap:+-W$wrap}" | wtrunc | htrunchead
+ perl <(cat <(echo -e '#!/usr/bin/perl\nuse utf8;') $(for c in $(echo $PATH":" | sed -e 's/:/\/'"$cmd"' /g'); do if [[ -f $c ]]; then echo $c; break; fi done)) -f "$pony" "${wrap:+-W$wrap}" | wtrunc | htrunchead
fi
else
- exec "$cmd" -f "$pony" "${wrap:+-W$wrap}" | wtrunc
+ perl <(cat <(echo -e '#!/usr/bin/perl\nuse utf8;') $(for c in $(echo $PATH":" | sed -e 's/:/\/'"$cmd"' /g'); do if [[ -f $c ]]; then echo $c; break; fi done)) -f "$pony" "${wrap:+-W$wrap}" | wtrunc
fi
}