bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ${b+s ''}


From: Robert Elz
Subject: Re: ${b+s ''}
Date: Wed, 20 Feb 2019 09:25:24 +0700

    Date:        Tue, 19 Feb 2019 10:41:41 -0500
    From:        Greg Wooledge <wooledg@eeg.ccf.org>
    Message-ID:  <20190219154141.di73jptd2ric63is@eeg.ccf.org>

  | Looks like the best workaround (for bash/ksh) is to store the -d '' args
  | in an array, and use something like:
  |
  | mapfile -t ${bNullDelimited+"${tmparray[@]}"}

No, the best workaround (which will work on all shells -- that the
command used here is bash specific is really irrelevant) was given in
the original message on this topic;

        > mapfile -t${bNullDelimited+d} ${bNullDelimited+''}

That works, and works everywhere (except ksh93, which is simply
broken), but is needlessly cumbersome (and slower, as the var needs
to be looked up twice.)

kre




reply via email to

[Prev in Thread] Current Thread [Next in Thread]