Hi,
In the request script I need to read user input and store to variable to use it later in postinstall script.
e.g.
LOGDIR=/app/log
echo "Please type the Log Directory : (current value: $LOGDIR)"
read LOGDIR
When asked, if the user enters a value the parameter is ok and I can use it later, but if the user presses enter then the LOGDIR value is set to "" and doesn't keep it's initial value.
In Linux I use a function
readDefault()
{
ARGS=""
N=1
LOCALBUF=""
until [ $N -eq $# ]
do
eval ARG=\${$N}
ARGS=" $ARGS $ARG"
N=`expr $N + 1`
done
read $ARGS LOCALBUF
if [ -n "$LOCALBUF" ]
then
VARNAME=${!#}
export $VARNAME=$LOCALBUF
else
echo "Using current value."
fi
}
But in the Solaris request script I get " bad substitution" at line readDefault LOGDIR
Thanks,
Bianca