Discussion:
[ubuntu-us-mi] bash here-doc and history
Robert Citek
2010-10-01 14:08:46 UTC
Permalink
I get the following odd behaviour with a here doc in bash:

$ { cat <<eof
eof
}

Then press up-arrow. And I see this:

$ { cat <<eof
eof
; }

Press Enter, I get an error:

-su: syntax error near unexpected token `;'

Bash has inserted a semi-colon before the "}".

This is with bash 4.1.5(1)-release on Ubuntu Linux 10.04. Anyone
else seeing this?

Regards,
- Robert
Scott Moser
2010-10-01 14:26:43 UTC
Permalink
Post by Robert Citek
$ { cat <<eof
eof
}
$ { cat <<eof
eof
; }
-su: syntax error near unexpected token `;'
Bash has inserted a semi-colon before the "}".
This is with bash 4.1.5(1)-release on Ubuntu Linux 10.04. Anyone
else seeing this?
I just verified on maverick. You should open a bug against bash
(ubuntu-bug bash).

I'm guessing its an upstream bug also, so you could raise it upstream. It
looks like the appropriate place to do that is
http://tiswww.case.edu/php/chet/bash/bashtop.html#Bugs
Robert Citek
2010-10-05 00:27:51 UTC
Permalink
Post by Scott Moser
Post by Robert Citek
$ { cat <<eof
eof
}
$ { cat <<eof
eof
; }
-su: syntax error near unexpected token `;'
Bash has inserted a semi-colon before the "}".
This is with bash 4.1.5(1)-release on Ubuntu Linux 10.04. ? Anyone
else seeing this?
I just verified on maverick. You should open a bug against bash
(ubuntu-bug bash).
I'm guessing its an upstream bug also, so you could raise it upstream. ?It
looks like the appropriate place to do that is
http://tiswww.case.edu/php/chet/bash/bashtop.html#Bugs
Thanks, Scott. I've sent an e-mail using bashbug.

Regards,
- Robert
Robert Citek
2010-10-05 13:45:14 UTC
Permalink
Thanks, Scott. ?I've sent an e-mail using bashbug.
And got a response (below). - Robert

---------- Forwarded message ----------
From: Chet Ramey <chet.ramey at case.edu>
Date: Tue, Oct 5, 2010 at 10:27 AM
Subject: Re: bash inserts semicolon into history when using here-document
To: robert.citek at gmail.com
Cc: bug-bash at gnu.org, bash at packages.debian.org, chet at po.cwru.edu
Bash Version: 4.1
Patch Level: 5
Release Status: release
When using a here-document at the command line, bash inserts a
semicolon into the history.
Thanks for the report. This has been fixed for the next release.

Chet

Loading...