zsh-users
 help / color / mirror / code / Atom feed
* curiosity with here document.
@ 2015-11-26 18:37 Ray Andrews
  2015-11-26 19:01 ` ZyX
  2015-11-26 19:03 ` ZyX
  0 siblings, 2 replies; 6+ messages in thread
From: Ray Andrews @ 2015-11-26 18:37 UTC (permalink / raw)
  To: Zsh Users

I often comment out blocks of code with here-document, and I just found 
this strange thing:

    /test1 ()/
    /{/
    /    if [[ "$1" = 'howdy' ]];/

    /: <<'COMMENT'/
    /blah blah
    COMMENT/

    /    then/
    /    echo stranger/
    /    fi/
    /}/

    /$ test1 no/
    /stranger/

There's no issue if I put the 'then' above the here-document. How should 
I understand that?  It is as if the here-document is hijacking the 'if' 
test and returning true. I'd expect the 'if' to go hunting for it's 
'then' and if it doesn't find it, then throw and error, but not let the 
here-document interlope.  But if this is proper then it's a caution as 
to using these things for commenting.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-11-27  2:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-26 18:37 curiosity with here document Ray Andrews
2015-11-26 19:01 ` ZyX
2015-11-26 19:03 ` ZyX
2015-11-26 23:19   ` Ray Andrews
2015-11-27  1:56     ` Bart Schaefer
2015-11-27  2:29       ` Ray Andrews

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).