Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #176550

Re: Re: Bash different behaviour of read / strings in jessie versus stretch (regression?)

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: Re: Bash different behaviour of read / strings in jessie versus stretch (regression?)
Date 2017-01-10 14:40 +0100
Message-ID <sY4OC-1Tf-37@gated-at.bofh.it> (permalink)
References <sXIEq-4UO-15@gated-at.bofh.it> <sXSkp-2vm-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jan 10, 2017 at 01:10:53AM +0100, foo fighter wrote:
> mapfile -t _array <<<"${_inputstring// /$'\n'}"

For larger inputs, this will probably be more efficient:

mapfile -t _array < <(your command | tr ' ' '\n')

Bash's substitution can be rather slow on large strings.

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Bash different behaviour of read / strings in jessie versus stretch  (regression?) "foo fighter" <lopiuh@gmx.net> - 2017-01-07 22:00 +0100
  Re: Bash different behaviour of read / strings in jessie versus stretch (regression?) Greg Wooledge <wooledg@eeg.ccf.org> - 2017-01-09 15:00 +0100
    Aw: Re: Bash different behaviour of read / strings in jessie versus  stretch (regression?) "foo fighter" <lopiuh@gmx.net> - 2017-01-10 01:20 +0100
      Re: Re: Bash different behaviour of read / strings in jessie versus stretch (regression?) Greg Wooledge <wooledg@eeg.ccf.org> - 2017-01-10 14:40 +0100

csiph-web