[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

read & presetting the text to read

From: Johannes Zellner
Subject: read & presetting the text to read
Date: Tue, 12 Jun 2001 19:51:06 +0200
User-agent: slrn/ (Linux)


I've a shell script which uses

    read -e -p "some prompt [$default] " reply
    if test "x" != "x${reply}"; then
        echo "${reply}"
        echo "${default}"

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:

    prompt> this text should be editable

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]