aboutsummaryrefslogtreecommitdiff
path: root/ponysay
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2012-02-26 20:33:18 +0100
committerJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2012-02-26 20:33:18 +0100
commit4066d4e0f219df7507a5b0e97e92efcd3dc3abaa (patch)
treeeb30f32613b119565bf32180ba4d3dac5ee4831f /ponysay
parent38f8c51bba0e63e47bbde6c4a3043a6bdfa22250 (diff)
downloadponysay-4066d4e0f219df7507a5b0e97e92efcd3dc3abaa.tar.gz
ponysay-4066d4e0f219df7507a5b0e97e92efcd3dc3abaa.tar.bz2
ponysay-4066d4e0f219df7507a5b0e97e92efcd3dc3abaa.zip
Move export into function
Diffstat (limited to 'ponysay')
-rwxr-xr-xponysay7
1 files changed, 3 insertions, 4 deletions
diff --git a/ponysay b/ponysay
index 42db27a..179a491 100755
--- a/ponysay
+++ b/ponysay
@@ -29,6 +29,9 @@ usage() {
}
say() {
+ # Ponies use UTF-8 drawing characters. Prevent a Perl warning.
+ export PERL_UNICODE=S
+
exec "$cmd" -f "$pony" "${wrap:+-W$wrap}"
}
@@ -60,10 +63,6 @@ if [[ ! -f $pony ]]; then
pony="${ponies[$RANDOM%${#ponies[@]}]}"
fi
-
-# Ponies use UTF-8 drawing characters. Prevent a Perl warning.
-export PERL_UNICODE=S
-
if [[ -n "$*" ]]; then
# Handle a message given via arguments
say <<<"$*"