[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

builtin read stops at '\0'

From: Rafaël Fourquet
Subject: builtin read stops at '\0'
Date: Wed, 18 May 2011 14:10:39 +0200

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu'
-DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/local/share/locale'
-DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g
uname output: Linux brahma 2.6.38-2-amd64 #1 SMP Sat Apr 23 18:47:49 UTC
2011 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.2
Patch Level: 0
Release Status: release

        The builtin read command does not work like e.g. dash or zsh w.r.t.
        the null character '\0', however I'm not sure it can be
        considered as a bug.
        If a line containing the '\0' is read into a variable, the content
        of this variable does not contain the part after the '\0' character.

        echo -e 'a\0b' | (read f; echo $f)

        The output is 'a', and '\0b' is stripped.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]