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    c...@case.edu    http://cnswww.cns.cwru.edu/~chet/

Reply via email to