From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10143 invoked by alias); 26 Nov 2015 18:37:16 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 20996 Received: (qmail 17727 invoked from network); 26 Nov 2015 18:37:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_HDRS_LCASE, T_MANY_HDRS_LCASE autolearn=ham autolearn_force=no version=3.4.0 X-Authority-Analysis: v=2.1 cv=X+5rdgje c=1 sm=1 tr=0 a=Uh/wpEIUX9UX0FOdpsyW1Q==:117 a=Uh/wpEIUX9UX0FOdpsyW1Q==:17 a=IkcTkHD0fZMA:10 a=zf4Pio6E7o--lRwZWvcA:9 a=-nH8sVzPTbaI7T3t:21 a=g7vBNzh-VYQV4Pbs:21 a=QEXdDO2ut3YA:10 Message-id: <56575158.1070303@eastlink.ca> Date: Thu, 26 Nov 2015 10:37:13 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-version: 1.0 To: Zsh Users Subject: curiosity with here document. Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit 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.