mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-12 07:46:44 +01:00
Move export into function
This commit is contained in:
parent
38f8c51bba
commit
4066d4e0f2
1 changed files with 3 additions and 4 deletions
7
ponysay
7
ponysay
|
@ -29,6 +29,9 @@ usage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
say() {
|
say() {
|
||||||
|
# Ponies use UTF-8 drawing characters. Prevent a Perl warning.
|
||||||
|
export PERL_UNICODE=S
|
||||||
|
|
||||||
exec "$cmd" -f "$pony" "${wrap:+-W$wrap}"
|
exec "$cmd" -f "$pony" "${wrap:+-W$wrap}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,10 +63,6 @@ if [[ ! -f $pony ]]; then
|
||||||
pony="${ponies[$RANDOM%${#ponies[@]}]}"
|
pony="${ponies[$RANDOM%${#ponies[@]}]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Ponies use UTF-8 drawing characters. Prevent a Perl warning.
|
|
||||||
export PERL_UNICODE=S
|
|
||||||
|
|
||||||
if [[ -n "$*" ]]; then
|
if [[ -n "$*" ]]; then
|
||||||
# Handle a message given via arguments
|
# Handle a message given via arguments
|
||||||
say <<<"$*"
|
say <<<"$*"
|
||||||
|
|
Loading…
Reference in a new issue