title: How to edit a single text line in BASH?
body: <p>BASH v3.2</p>
  
  <p>I use the command:</p>
  
  <pre><code>read -e name
  </code></pre>
  
  <p>which allows basic editing of what I'm typing. What I'm looking for is a command or script that prints an initial single string in a variable, which is then editable and with adjustable maximum length. Maximum string length would be 40 characters or so. Like a tiny, tiny text editor. AFAIK that cannot be done with the read command.
  Some functions would be delete, insert, backspace, left/right arrow keys, ESC (restore old text) and ENTER.</p>
  
  <p>Any ideas?</p>