bug-bash
[Top][All Lists]
Advanced

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

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


From: Jorge Alberto Baca Garcia
Subject: Character \001 disappears from here document if 'word' is unquoted.
Date: Thu, 12 Apr 2018 16:13:50 +0000 (GMT)

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.




reply via email to

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