Hi,
I've a shell script which uses
#v+
default=bla
read -e -p "some prompt [$default] " reply
if test "x" != "x${reply}"; then
echo "${reply}"
else
echo "${default}"
fi
#v-
now I'd rather like the $default to be stuffed into readline's
input line which is possible in readline AFAIK, but I don't know
how to do it in bash.
Example: I'd like to have a prompt and a preset text like this:
#v+
prompt> this text should be editable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#v-
where the cursor is behind the end of the line and everything which is
underlined is editable and returned in the variable 'reply'.
Is this possible with bash and how ?
Any help much appreciated.
--
Johannes
[Prev in Thread]
Current Thread
[Next in Thread]
read & presetting the text to read,
Johannes Zellner<=