From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8827 invoked by alias); 9 Feb 2018 15:27:24 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42352 Received: (qmail 1251 invoked by uid 1010); 9 Feb 2018 15:27:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f175.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.128.175):SA:0(-1.9/5.0):. Processed in 2.441259 secs); 09 Feb 2018 15:27:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: stephane.chazelas@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LpCWo6DJCCROFNqAHqqpnM5DiIXqUfRMqTnskkmuqcQ=; b=q7AUiwnBrTTXGaQRI5j6+JGycEIP/g/SNu+jpFtzWBbYE9oUrWsjBCAjbq3F5G3rmx dX32GXNiSrir0tDF0aMZOoCewdYMdO9JfB8Xikd7a9XDwOFn412R9V6CDrpIdvYQdERo DN2ykBGcUSQ7asoANgufwjg505y86eCkrVKnbtdJzSb9pjtwvDQ5AEVymkTr68doBXt2 mxRzn/VtwuHWaCTKmoyChGUNbY7xGJ3hHC0czI4j4fuwNISgrfhECrU2jawG2GTWuxUU NLUlxYEy1LMx8nJzudaITcYFW/m1Nhx8zH/9PONSwcIDautMMNL0uULOdVkPYdZeeeUu E3YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=LpCWo6DJCCROFNqAHqqpnM5DiIXqUfRMqTnskkmuqcQ=; b=P3uiFWjnons1W0N/gDGXz3XSlGkj6uUgaqPATAFJpi6c+C5wzZnz+BKduh57I8pzIf UP1QCVcvU/m5NO8LHLnOWDcw2x5EPJ7lJgHtSJFrNnMmSyBnRtUHJS0D/ZptyfVJ5sDM gKEE+kqU9DHCQPEdct/Ge1lBJv+CGOxkT96fTdTxUEWiEmlUgv7orWHnmRGQ0yHusOfv qvAbDAysZHDARQ4G54and68pOorcn3iU3XScGpYvCDkEsDDMpQ6ayuRnaZ6EfRekG/jI nVbl/tgM8BndKzeb2fju0auTqqBfU88nws9gLjMfF/5v8cIxjjoYKAuW9TfiS9SvuvzE v5yQ== X-Gm-Message-State: APf1xPBZ/fvS5yDaRmYQ1X2DgEAxMWIOvY83CVqYn2LqxLoBm0lFwEPq wPaKq240gY/5aofwSIz6g44= X-Google-Smtp-Source: AH8x227UBXmRzSpRs5VuP1X14BJd1ARGgczkr6lL7FGmpdbvSACRGr3Za3bA9v+e+zLaPQ0n7T0zsg== X-Received: by 10.223.177.150 with SMTP id q22mr3091451wra.20.1518190037393; Fri, 09 Feb 2018 07:27:17 -0800 (PST) Date: Fri, 9 Feb 2018 15:27:15 +0000 From: Stephane Chazelas To: Peter Stephenson Cc: Zsh hackers list Subject: Re: '<<-' here-documents oddity with line continuation Message-ID: <20180209152715.GA14126@chaz.gmail.com> Mail-Followup-To: Peter Stephenson , Zsh hackers list References: <3216ee27-0c11-013d-3b32-55c8dc8587c3@inlv.org> <20180209092427.6eaeafc7@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180209092427.6eaeafc7@pwslap01u.europe.root.pri> User-Agent: Mutt/1.5.24 (2015-08-30) 2018-02-09 09:24:27 +0000, Peter Stephenson: > On Fri, 9 Feb 2018 08:01:41 +0100 > Martijn Dekker wrote: > > Meanwhile I would welcome opinions whether either or both of these > > issues should be fixed unconditionally, or in emulation only -- and, if > > the latter, what shell option to attach it to. POSIX_STRINGS maybe? > > Thanks for the patch. > > I think the question is whether existing users are more likely to be > relying on this behaviour, or simply finding it confusing. I'd actaully > hazard the latter --- line continuation is more useful if it's doing > something a bit more predictable --- so I'd be inclined just to include > the patch. But I expect there are arguments the other way. [...] I agree it makes sense of treating it as a minor compatibility bug fix. Note that there's also: cat << EOF foo E\ OF which zsh does differently from other shells (and that nobody would ever do). About order and token recognition to reply on Martijn's initial report, note that in: echo "$(echo 'foo\ bar')" Or echo "$(cat << 'EOF' foo\ bar EOF )" The \ is meant *not* to be treated as a line continuation. bash fixed a bug recently for that (the latter used to output "foobar", it's only fixed on the development branch). So there has to be some level of tokenisation and parsing done before line continuation is handled. It's not like in C where it's done as one of the first steps of the pre-processing stage.