Solaris request script

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

check if the variable LOGDIR is empty after the "read". if so set it to the (before) saved value.

USER1="root"
echo "Please enter the user to run the XSS process (press ENTER for $USER):"
read USER
if [ "${USER}" = "" ]
then
USER=$USER1
fi

This would be a way but is not so elegant. And I need about 15 user inputs.

Bianca