Hi,
There is a install script(install.sh) for installation of our product and I am working on automating the process of installation using ksh script.
But the problem is that the install script does a "more" command on a file and then asks few questions..I do not know how to handle the "more" command.
Any help would be appreciated.
I am pasting a dummy install.sh script and my auto.sh script
-------install.sh------------#!/bin/ksh
DIR=`pwd`
LIC_FILE=$DIR/lic
LOGFILE=$DIR/log
log ()
{
DATE=`date '+%m/%d/%y %H:%M:%S'`
echo "[${DATE}] $1" >> $LOGFILE
}
ifYes ()
{
echo ""
/bin/echo "$* [Yes]: \c"
read ans
case $ans in
""|[yY]*) return 0 ;;
*) return 1 ;;
esac
}
if [ -f $LOGFILE ]; then
rm -rf $LOGFILE
fi
more $LIC_FILE
if ifYes "Are you
Testing POP?"
then
log "Good luck for POP ...continue"
else
log "Not POP.Good Day"
fi
if ifYes "Are you testing NetConnect?"
then
log "Good luck for NetConnect..."
else
log "Not NetConnect.Good Day"
fi
------auto.sh---------
#!/bin/ksh
DIR=`pwd`
OUT=$DIR/log
$DIR/install.sh << EOF
Y
Y
EOF