#!/bin/sh # set SAVEPWD to current dir. and set PATH to contain current dir. Curdir=`pwd` PATH=.:$PATH:$Curdir export PATH export Curdir gawkbin=awk export gawkbin # ¨M©w¤£´«¦æ script echoprompt=`echo -n "."` if test "$echoprompt" = "."; then echomode="-n "; echocr="" else echoprompt=`echo ".\c"` if test "$echoprompt" = "."; then echomode=""; echocr="\c" else echomode="-e "; echocr="\c" fi fi # if test "$LOGNAME" != "root"; then rootmessage="y" while test "$rootmessage" = "y" do clear echo " ";echo " " echo " " echo " **********************************************" echo " * *" echo " * You are not a super user 'root' *" echo " * *" echo " **********************************************" echo " " echo " c. Continue to install." echo " q. quit." echo " " echo $echomode " Type 'c' or 'q' : "$echocr read inkey case $inkey in "c") rootmessage="n";; "q") rootmessage="n"; rm -f *@;exit;; *) rootmessage="y";; esac done fi Asktmpdir(){ message="y" while test "$message" = "y" do clear echo " ";echo " ";echo " " echo " In the following, it will start to install chitex " echo " Choose one of the following:" echo " " echo " 1. Use /usr/local/src/chitex612 as temporay files dir." echo " 2. Choose other dir. as temporay files dir." echo " q. quit" echo " " echo " " echo $echomode " Type '1', '2' or 'q' : "$echocr #echo $echomode " "$echocr read inkey case $inkey in "1") message="n"; tmpdir="/usr/local/src/chitex612";; "2") message="n" clear echo " ";echo " ";echo " " echo " Type the pathname of the temporay files dir." echo " (Press enter key to go back)" echo " " echo $echomode " The temporay files dir. : "$echocr read inkeya if test "$inkeya" = ""; then message="y" else message="n" tmpdir=$inkeya fi ;; "q") message="n"; exit;; *) message="y";; esac done } messagea="y" while test "$messagea" = "y" do Asktmpdir; messageb="y" while test "$messageb" = "y" do clear echo " " echo " " echo " The temporary files dir. you have chosen is: " echo " $tmpdir " echo " " echo " 1. Accept" echo " 2. Cancell and redo it" echo "" echo "" echo $echomode " Type '1' or '2': "$echocr read inkeyb case $inkeyb in "1") messageb="n";messagea="n" ;; "2") messageb="n";messagea="y" ;; *) messageb="y" ;; esac done done if test ! -s $tmpdir; then mkdir -p $tmpdir fi export tmpdir echo $tmpdir > /tmp/tmpdir@ cd $tmpdir gunzip -dc $Curdir/chitex6121.tar.gz|tar xvf - gunzip -dc $Curdir/chitex6122.tar.gz|tar xvf - cd chitex612 ./chsetup # $Curdir/chitex612/chsetupbig5 exit