Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: read options to slurp empty lines ?
- X-seq: zsh-users 23427
- From: Marc Chantreux <eiro@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: read options to slurp empty lines ?
- Date: Sun, 3 Jun 2018 00:06:29 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- 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==
- In-reply-to: <CAH+w=7bUdOB2DjCZmf5zWhL-9dM0ScSt6zPzuAmJK3EmEDsiyQ@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20180601214714.GA11281@prometheus.u-strasbg.fr> <CAH+w=7bUdOB2DjCZmf5zWhL-9dM0ScSt6zPzuAmJK3EmEDsiyQ@mail.gmail.com>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author