[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: read -e bug
From: |
Pierre Gaston |
Subject: |
Re: read -e bug |
Date: |
Thu, 28 May 2009 16:00:37 +0300 |
On Thu, May 28, 2009 at 3:52 PM, Chris F.A. Johnson <cfaj@freeshell.org> wrote:
> On Thu, 28 May 2009, Chet Ramey wrote:
>
>> >
>> > This is nothing new; it happens in all versions of bash:
>> >
>> > printf "Enter something: "
>> > read -e whatever
>> >
>> > Press a key, then cursor left (or ^A); the cursor moves to the
>> > beginning of the line, over "E" instead of over the character just
>> > entered.
>>
>> This isn't a bug; that's where readline thinks the cursor is.
>
> Why would it think that? It's wrong.
>
>> If you want to use a prompt, use `read -p'.
>
> I like to write portable scripts; read -p is not portable.
well, read -e is not more portable than read -p afaict
> --
> Chris F.A. Johnson, webmaster <http://woodbine-gerrard.com>
> ===================================================================
> Author:
> Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
>
>
>