zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: Zsh Users <zsh-users@zsh.org>
Subject: curiosity with here document.
Date: Thu, 26 Nov 2015 10:37:13 -0800	[thread overview]
Message-ID: <56575158.1070303@eastlink.ca> (raw)

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.


             reply	other threads:[~2015-11-26 18:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 18:37 Ray Andrews [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56575158.1070303@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).