bug-bash
[Top][All Lists]
Advanced

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

Re: <<! ^D how about an extra newline, dudes?


From: Chet Ramey
Subject: Re: <<! ^D how about an extra newline, dudes?
Date: Mon, 26 Nov 2001 11:34:40 -0500

> In the first example I end input with c RET
> In the second example I end input with ^D
> 
> $ cat<<c
> > 1
> > 2
> > c
> 1
> 2
> $ cat<<c
> > 1
> > 2
> > 1
> 2
> 
> In the second example it would seem prudent for bash 2.05.0(1) to give
> an newline before making output, for clarity's sake.

Why?  You've not told it to add one.

> Well, I'm not
> sure what's going on but it looks ugly, and I remember EOF is also a
> valid terminator of "here documents", I think.

According to POSIX.2 it's not; POSIX.2 says it should be treated as a
syntax error.  Bash is helping you out here.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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