Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!sunic!dkuug!harald.ruc.dk!jba From: jba@harald.ruc.dk (Jan B. Andersen) Newsgroups: comp.sys.ncr Subject: Re: startup menu and changing the system time/date Message-ID: <213@harald.UUCP> Date: 6 Feb 90 16:35:41 GMT References: <2290@texbell.swbt.com> Organization: RUC - Roskilde University Center, Denmark Lines: 57 I have written a script, bdate, which gets called at the bottom of /etc/bcheckrc. It's not a menu, but it works fine for us. --------------[ /etc/bdate ]------------ dig2() { if [ $1 -lt 10 ] then digits="0"`expr $1 + 0` else digits=$1 fi } TZ=DNT-1DST export TZ echo "\nSETTING System Date And Time\n" ls -l > /dev/null; echo "\007\c" ls -l > /dev/null; echo "\007\c" ls -l > /dev/null; echo "\007\c" echo "\nThe current date and time is : `date` \n" echo "Is the above information correct?\c" echo "\tEnter \"y\" for yes or \"n\" for no : \007\c" read answer if [ $answer = n ] then set `date "+%m %d %H %M %y"` m=$1 d=$2 h=$3 n=$4 y=$5 newdt= echo "\nEnter the month\t\t[$m] \c" read val ; dig2 ${val:-$m} ; newdt=$digits echo "Enter the day\t\t[$d] \c" read val ; dig2 ${val:-$d} ; newdt=${newdt}$digits echo "Enter the hour\t\t[$h] \c" read val ; dig2 ${val:-$h} ; newdt=${newdt}$digits echo "Enter the minute\t[$n] \c" read val ; dig2 ${val:-$n} ; newdt=${newdt}$digits echo "Enter the year\t\t[$y] \c" read val ; dig2 ${val:-$y} ; newdt=${newdt}$digits fi date $newdt >/dev/null case $? in 0) echo "\nThe new date and time is : `date` \n" ;; *) $0 esac