I have the following snippet in a bash script written in Solaris 10:
printf "port(389)="
read PORT
if [[ $PORT == "" ]]; then
PORT=389
fi
What I am trying to get that if the user hits the enter key, the Port should be set to 389.
The snippet above does not seem to be working.
Any suggestions?
It’s not exactly what you asked, but Solaris has a set of utilities for this sort of thing.
Check out the other /usr/bin/ck* utilities to prompt the user for other types of data, including things like files or user names.