You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
323 B
17 lines
323 B
2 years ago
|
#!/bin/sh
|
||
|
|
||
|
NUM=0
|
||
|
TOL=0
|
||
|
for cow in /usr/share/cowsay/cows/*.cow ; do
|
||
|
TOL=$((TOL+1))
|
||
|
done
|
||
|
|
||
|
SELECT=$(((`date +%M | sed -e 's|^0||'`*60+`date +%S | sed -e 's|^0||'`)%(TOL)))
|
||
|
|
||
|
for cow in /usr/share/cowsay/cows/*.cow ; do
|
||
|
NUM=$((NUM+1))
|
||
|
if [ $NUM = $SELECT ] ; then break ; fi
|
||
|
done
|
||
|
|
||
|
exec /usr/bin/cowsay -f $cow "$@"
|