From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7448 invoked by alias); 2 Jun 2018 22:06:39 -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: List-Unsubscribe: X-Seq: 23427 Received: (qmail 9932 invoked by uid 1010); 2 Jun 2018 22:06:39 -0000 X-Qmail-Scanner-Diagnostics: from aurora-borealis.phear.org 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(94.242.205.164):SA:0(-1.9/5.0):. Processed in 1.304605 secs); 02 Jun 2018 22:06:39 -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,SPF_PASS, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: eiro@phear.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: amavisd-new at phear.org DKIM-Filter: OpenDKIM Filter v2.10.3 aurora-borealis.phear.org 5E62610A5C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=phear.org; s=20180217; t=1527977191; bh=g0eA4wb2L+SJgA+hcncLhzRyYdkofP4D67V5T0xioq4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ixt58B5nKYE2rDZA6CWM2dZNpC8ZW93w2dc32cPjILrOOJtOVJ1wypa0UYmko0OC4 /BU+GWCsDmg9TQMac6vHKNZsviLarzCz4/SBIBKjRs70i4rU4xaFXMKPTSHqIC8Zrz B7mb7QBuVEPID1H//WuBSEpRR9oPvijG/wHL+RvzuCQjkNz3iD1L2f3s9uFixj1Cqn 9V/Wdvp6BaUIv//g4HDedNZVWztAuIAK4oTE1J8ii4uDqeshXQeqqg+mZepQhrx0Ye 5Gef9CiuFJd93jCHOAGepouf5IvB8MdB/Yhj+6yS2ckQyAm/0a3I9WUPqi70tHFBZa RfT2wDK/iyrvA== Date: Sun, 3 Jun 2018 00:06:29 +0200 From: Marc Chantreux To: Bart Schaefer Cc: Zsh Users Subject: Re: read options to slurp empty lines ? Message-ID: <20180602220629.GA8646@prometheus.u-strasbg.fr> References: <20180601214714.GA11281@prometheus.u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) hello Bart, > slurp() { > local REPLY > IFS= read -d '' && > set -A ${1:-reply} "${(@f)REPLY}" > } i added this code in uze.zsh and spotted a bug thanks to my test suite (https://github.com/zsh-uze/uze/blob/master/t/100_dump.t) the thing is the first line doesn't survive to the (@f) modifier so: print -l '' a '' b | read -r -d '' lines for it ( "${(@f)lines}" ) l "* ($it)" got: * (a) * () * (b) expected: * () * (a) * () * (b) so i reverted the code for the moment waiting for the moment i can use a code closer than yours. regards marc