ponysay/ponysay.sh

24 lines
477 B
Bash
Raw Normal View History

2012-07-21 15:43:21 +02:00
#!/usr/bin/env bash
2012-02-26 19:52:17 +01:00
2012-08-01 03:33:30 +02:00
# KMS ponies extension
2012-07-21 18:16:18 +02:00
kmscmd=""
[ "$TERM" = "linux" ] && kmscmd=$(for c in $(echo $PATH":" | sed -e 's/:/\/ponysay2kmsponysay /g'); do if [ -f $c ]; then echo $c; break; fi done)
[ ! "$kmscmd" = "" ] && TERM="-linux-"
2012-07-21 18:16:18 +02:00
2012-05-07 16:07:39 +02:00
2012-08-01 03:33:30 +02:00
# Function for printing the ponies and the message
say() {
2012-08-01 03:33:30 +02:00
# KMS ponies support
if [ "$kmscmd" = "" ]; then
2012-07-21 18:16:18 +02:00
function runcmd {
cowcmd -f "$pony" "$@"
}
else
function runcmd {
cowcmd -f <($kmscmd "$pony") "$@"
}
fi
2012-08-01 03:33:30 +02:00
}