Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: read options to slurp empty lines ?



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