[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[BUG?] read -n limits bytes, not characters
From: |
Jan Schampera |
Subject: |
[BUG?] read -n limits bytes, not characters |
Date: |
Tue, 13 Nov 2007 17:12:33 +0100 |
User-agent: |
IceDove 1.5.0.14pre (X11/20071018) |
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib
-g -O2
uname output: Linux mainserver 2.6.18-5-486 #1 Tue Oct 2 23:38:54 UTC
2007 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu
Bash Version: 3.1
Patch Level: 17
Release Status: release
Description:
read -n limits bytes, not characters
Repeat-By:
read -n1 <<< '(some weird unicode character)'
echo "$REPLY"
Also tested with 3.2 patchlevel 25 (IIRC).
The documentation says
/-----
| -n nchars
| read returns after reading nchars characters rather than waiting
| for a complete line of input.
\-----
If it's the intended behaviour, the documentation should be changed. I
can't provide a fix, sorry.
Ah yes, my locale:
/-----
| LANG=de_DE.UTF-8
| LC_CTYPE="de_DE.UTF-8"
| LC_NUMERIC="de_DE.UTF-8"
| LC_TIME="de_DE.UTF-8"
| LC_COLLATE="de_DE.UTF-8"
| LC_MONETARY="de_DE.UTF-8"
| LC_MESSAGES="de_DE.UTF-8"
| LC_PAPER="de_DE.UTF-8"
| LC_NAME="de_DE.UTF-8"
| LC_ADDRESS="de_DE.UTF-8"
| LC_TELEPHONE="de_DE.UTF-8"
| LC_MEASUREMENT="de_DE.UTF-8"
| LC_IDENTIFICATION="de_DE.UTF-8"
| LC_ALL=
\-----
--
This is my life - this is my net!
- Jan
- [BUG?] read -n limits bytes, not characters,
Jan Schampera <=