Linux Operating System (MOSC)

MOSC Banner

Offering a default on return in a shell script input prompt

edited Oct 13, 2011 6:47AM in Linux Operating System (MOSC) 7 commentsAnswered
Hi ... I'm ashamed to ask this. 

.

I obviously don't have bash4 as the following doesn't work:

.

$ read -e -p "Enter database SID, or just return for default: " -i "swmfolx" ORACLE_SID
-bash: read: -i: invalid option
read: usage: read [-ers] [-u fd] [-t timeout] [-p prompt] [-a array] [-n nchars] [-d delim] [name ...]

.

'All' I am trying to do is prompt for input with the option of just return for defaults.

.

The Googlesphere is remarkably silent on this!  Any links or advice would be gratefully acknowledged.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center