Eval ${#name[subscript]} incorrect when having multibyte characters.

2008-07-07 Thread Wang Xin
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linu x-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/ local/share/locale'

Bash/readline enhancement: wish to pre-set initial value of input text

2008-07-07 Thread Richard Neill
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

Bash substrings: wish for support for negative length (read till n from end)

2008-07-07 Thread Richard Neill
Dear All, Substrings in bash contain 2 parameters, the start and the length. Start may be negative, but if length is negative, it throws an error. My request is that bash should understand negative length. This would be useful in some occasions, and would be similar to the way PHP does it:

Re: Bash substrings: wish for support for negative length (read till n from end)

2008-07-07 Thread Jan Schampera
Richard Neill wrote: $ echo ${stringZ:2: -1} #Wish: start at 2, read till ERROR #1 before the end. i.e. # cde $ echo ${stringZ: -3: -1} #Wish: start 3 back, read till ERROR #1 before the end.

Re: Bash substrings: wish for support for negative length (read till n from end)

2008-07-07 Thread Jan Schampera
Jan Schampera wrote: Richard Neill wrote: $ echo ${stringZ:2: -1} #Wish: start at 2, read till ERROR#1 before the end. i.e. # cde $ echo ${stringZ: -3: -1}#Wish: start 3 back, read till ERROR

Re: Bash substrings: wish for support for negative length (read till n from end)

2008-07-07 Thread Richard Neill
Jan Schampera wrote: Richard Neill wrote: $ echo ${stringZ:2: -1} #Wish: start at 2, read till ERROR#1 before the end. i.e. # cde $ echo ${stringZ: -3: -1}#Wish: start 3 back, read till ERROR