Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14043 > unrolled thread

Character \001 disappears from here document if 'word' is unquoted.

Started byJorge Alberto Baca Garcia <bacagarcia@me.com>
First post2018-04-12 16:13 +0000
Last post2018-04-12 16:13 +0000
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug


Contents

  Character \001 disappears from here document if 'word' is unquoted. Jorge Alberto Baca Garcia <bacagarcia@me.com> - 2018-04-12 16:13 +0000

#14043 — Character \001 disappears from here document if 'word' is unquoted.

FromJorge Alberto Baca Garcia <bacagarcia@me.com>
Date2018-04-12 16:13 +0000
SubjectCharacter \001 disappears from here document if 'word' is unquoted.
Message-ID<mailman.12175.1523552356.27995.bug-bash@gnu.org>
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 -O0 -Wno-parentheses -Wno-format-security
uname output: Linux jbaca-ubuntu 4.13.0-36-generic #40-Ubuntu SMP Fri Feb 16 20:07:48 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.4
Patch Level: 18
Release Status: release

Description:
Character \001 disappears from here document if 'word' is unquoted.

Repeat-By:
Running a script such as:

#!/bin/bash
cat << EOF
^A^B^C
EOF

Where:
^A = decimal value 1
^B = decimal value 2
^C = decimal value 3

The output of the script will be "\002\003\n". Decimal value 1 disappears.

Function 'expand_word_internal()' expands the word from "\001\002\003\n" to its internal string representation "\001\002\001\003\n",
instead of "\001\001\001\002\001\003\n" which I believe should be the correct expansion.

Also, if I include decimal value 1 twice in a row, such as "\001\001", then, only one of them is actually printed on the script's output.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web