bug-bash
[Top][All Lists]
Advanced

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

RE: bash: bug report Here document and Command substitution


From: Yves Crespin
Subject: RE: bash: bug report Here document and Command substitution
Date: Mon, 22 Jan 2001 21:52:31 +0100

This command follow POSIX rules and it's work fine with the Korn shell.

-----Message d'origine-----
De:     Chet Ramey [SMTP:chet@nike.INS.CWRU.Edu]
Date:   samedi 20 janvier 2001 18:31
À:      ycrespin@compuserve.com
Cc:     bug-bash@gnu.org; chet@po.cwru.edu
Objet:  Re: bash: bug report Here document and Command substitution

 
> The following syntax do not work (parse error).
> 
> echo $(cat <<-EOF
>         this is a )
>         EOF
> )

It's lazy evaluation.  Bash doesn't parse the contents of a command
substitution until it's time for the command to be executed.  Since
the closing right paren is seen first, before the here document
parse is attempted, a syntax error will occur later.

Parsing commands inside $(...) at the same time the command containing
the $(...) is being parsed is very hard to do with a yacc-based parser.

-- 
``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]