[Top][All Lists]

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

Re: prefilling keyboard buffer

From: Chris F.A. Johnson
Subject: Re: prefilling keyboard buffer
Date: Sat, 16 Jun 2007 19:22:35 -0400
User-agent: slrn/ (Linux)

greno wrote:
> How can the keyboard buffer be prefilled with an answer for a read command?
> I want to prompt the user with a question using the read command and then
> suggest an answer that they could backspace over and change if necessary.  

default="Something or other"
history -s "$default"
read -ep "Press up arrow to edit \"$default\": " XX

   Chris F.A. Johnson                      <http://cfaj.freeshell.org>
   Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)

reply via email to

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