This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hello,
a simple (i hope ;->) question for bash scripting experts:
I want to write a script, that interactivly prompts the user for a couple of input items. So my bash code looks like this: read -er -p"ItemX: " ITEMX Most of the items have default values, and I would find it very user-friendly, if readline's edit buffer would be pre- initialized with this default value, instead of an empty string. Then the user just has to hit <return> to enter the default value, very comfortable.
Any idea how to achieve this? Thanks.
echo -n "Input [default]: " read input [ -z "$input" ] && input=default
-- Matthew Ngx iqct zgg dxei zodt gf ngxk iqfrl.
-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |