[Bug 1837202] [NEW] leading tabs in here-documents are always stripped even when they should not
Detlev Zundel
dzu at member.fsf.org
Fri Jul 19 09:58:41 UTC 2019
Public bug reported:
Here documents from the command line with tabs are not handled
correctly. Here is a transcript showing the problem - there is a tab in
front of "This is indented" in the file:
dzu at zarniwoop:~$ cat tab-test
#!/bin/bash
cat <<STOP
This is unindented
This is indented
STOP
dzu at zarniwoop:~$ bash tab-test
This is unindented
This is indented
dzu at zarniwoop:~$ echo "Now using mouse to copy&paste here-document"
Now using mouse to copy&paste here-document
dzu at zarniwoop:~$ cat <<STOP
> This is unindented
> This is indented
> STOP
This is unindented
This is indented
dzu at zarniwoop:~$
Dash handles this correctly:
dzu at zarniwoop:~$ dash
$ dash tab-test
This is unindented
This is indented
$ echo "Now using mouse to copy&paste here-document"
Now using mouse to copy&paste here-document
$ cat <<STOP
This is unindented
This is indented
STOP
> > > This is unindented
This is indented
$
The prompts in the dash output are suspicious but redirecting the output
into a file yields correct output.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: bash 4.4.18-2ubuntu1.2
ProcVersionSignature: Ubuntu 4.18.0-25.26~18.04.1-generic 4.18.20
Uname: Linux 4.18.0-25-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
CurrentDesktop: GNOME
Date: Fri Jul 19 11:45:27 2019
InstallationDate: Installed on 2019-05-28 (51 days ago)
InstallationMedia: Ubuntu 18.04.2 LTS "Bionic Beaver" - Release amd64 (20190210)
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=de_DE.UTF-8
SHELL=/bin/bash
SourcePackage: bash
UpgradeStatus: No upgrade log present (probably fresh install)
** Affects: bash (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug bionic
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/1837202
Title:
leading tabs in here-documents are always stripped even when they
should not
Status in bash package in Ubuntu:
New
Bug description:
Here documents from the command line with tabs are not handled
correctly. Here is a transcript showing the problem - there is a tab
in front of "This is indented" in the file:
dzu at zarniwoop:~$ cat tab-test
#!/bin/bash
cat <<STOP
This is unindented
This is indented
STOP
dzu at zarniwoop:~$ bash tab-test
This is unindented
This is indented
dzu at zarniwoop:~$ echo "Now using mouse to copy&paste here-document"
Now using mouse to copy&paste here-document
dzu at zarniwoop:~$ cat <<STOP
> This is unindented
> This is indented
> STOP
This is unindented
This is indented
dzu at zarniwoop:~$
Dash handles this correctly:
dzu at zarniwoop:~$ dash
$ dash tab-test
This is unindented
This is indented
$ echo "Now using mouse to copy&paste here-document"
Now using mouse to copy&paste here-document
$ cat <<STOP
This is unindented
This is indented
STOP
> > > This is unindented
This is indented
$
The prompts in the dash output are suspicious but redirecting the
output into a file yields correct output.
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: bash 4.4.18-2ubuntu1.2
ProcVersionSignature: Ubuntu 4.18.0-25.26~18.04.1-generic 4.18.20
Uname: Linux 4.18.0-25-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
CurrentDesktop: GNOME
Date: Fri Jul 19 11:45:27 2019
InstallationDate: Installed on 2019-05-28 (51 days ago)
InstallationMedia: Ubuntu 18.04.2 LTS "Bionic Beaver" - Release amd64 (20190210)
ProcEnviron:
TERM=xterm-256color
PATH=(custom, no user)
XDG_RUNTIME_DIR=<set>
LANG=de_DE.UTF-8
SHELL=/bin/bash
SourcePackage: bash
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1837202/+subscriptions
More information about the foundations-bugs
mailing list