bug-bash
[Top][All Lists]
Advanced

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

Re: Bug: shell history loses lines beginning with # in a here-document


From: Chet Ramey
Subject: Re: Bug: shell history loses lines beginning with # in a here-document
Date: Sat, 01 Oct 2011 13:59:37 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2

On 9/30/11 3:40 PM, Jonathan Wakely wrote:

> Run these command:
> 
> $ gcc -x c - <<EOT
>  #include <stdio.h>
>  int main() { printf("hi\n"); }
>  EOT
> $ ./a.out
> hi
> 
> now use the up cursor (or "fc -2" or any equivalent) to return to the
> gcc command, it has been
> mangled to:
> 
> gcc -x c - <<EOTint main() { printf("hi\n"); }
> EOT
> 
> This is not the same command.
> A # in a here-document is not a shell comment!

Thanks for the report.  I'll take a look.  The problem is probably that
the code that adds lines to history doesn't know that the shell is
collecting a here-document at the time.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    chet@case.edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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