Hi,
I'm porting an install script from AIX to Red Hat (2.6.18-164.el5 #1 SMP)
I have this script working in both AIX and HP-UX.
The script is a wrapper for a Micro Focus Server Express install program. It responds to the install program questions with a here-now list. Responses includes y, n, strings and a return. It looks to see if the software has already been installed and uses 2 different sets of responses.
The code for the here-now:
Quote:
if [[ -d /opt/lib/mflmf ]]; then
#
# perform install with no prompt to create /opt/lib/mflmf directory
#
print " - run install with existing /opt/lib/mflmf direc
tory"
sh ./install << EOF
y
y
y
n
y
n
y
64
n
n
EOF
else
#
# perform full install from scratch
print " - run install with no /opt/lib/mflmf directory"
sh ./install << EOF
y
y
y
n
y
/opt/lib/mflmf
y
n
y
64
n
n
EOF
fi
When I run this in Red Hat it fails. It seems to confuse the shell when it sees a blank line as it seems to dump the rest of the list and loops on a missing response.
Here is the failure point.
|
environment (and any compatibility environments). |
|
Please press return when you are ready: |
y |
n |
y |
/opt/lib/mflmf |
y |
n |
y |
64 |
n |
n |
:::::::::::::: |
docs/env.txt |
:::::::::::::: |
It responds correctly to the first 2 "y"s in the list. When it hits the blank line (return) is seems to accept a return but it grabs the remaining list of responses so the install program loops waiting for a response.
I've tried a blank line, multiple blank lines, a line with a blank character, /n and /r. Nothing seems to work.
Any help would be appreciated.
Mike