Richard Neill wrote: > Dear All, > > When using read, it would be really neat to be able to pre-fill the form > with a default (or previous) value. > > For example, a script which wants you to enter your name, and thinks > that my name is Richard, but that I might want to correct it. > Alternatively, this would be useful within a loop, to allow correction > of previously-entered text, without fully typing it again.
A bit of the functionality (in some way) is already there. You can preload the commandline history and use read -e: --snipsnap-- If -e is supplied and the shell is interactive, readline is used to obtain the line. --snipsnap-- A bit of hard work, though. J.