--- src/fortune-zh.orig 2010-06-13 10:07:36.000000000 +0800 +++ src/fortune-zh 2010-06-13 10:10:00.000000000 +0800 @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # fortune-zh v1.2 # @@ -18,7 +18,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -FORTUNE="/usr/bin/fortune" +FORTUNE="/usr/games/fortune" CMD=`basename "$0"` if [ -f $HOME/.fortune-zh.conf ] @@ -32,16 +32,13 @@ LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT \ LC_IDENTIFICATION LC_ALL; do - if [ ! -z ${!category} ] - then - LANG="${!category}"; - break; - fi + eval LANG="\$$category" + [ x"$LANG" = x ] || break done CHARSET=`echo ${LANG#*.} | tr A-Z a-z | sed -e 's/-//g'` -if test $CMD == "fortune-zh"; then +if test $CMD = "fortune-zh"; then case "$CHARSET" in big5) LC_ALL=zh_CN.GB18030 $FORTUNE $FILE | autob5 @@ -50,7 +47,7 @@ LC_ALL=$LANG $FORTUNE $FILE ;; esac -elif test $CMD == "fortune-sc"; then +elif test $CMD = "fortune-sc"; then case "$CHARSET" in big5) echo 'Not available in BIG5 environment, try UTF-8' @@ -59,7 +56,7 @@ LC_ALL=$LANG $FORTUNE $FILE ;; esac -elif test $CMD == "fortune-tc"; then +elif test $CMD = "fortune-tc"; then case "$CHARSET" in gb*) echo 'Not available in GB environment, try UTF-8'