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

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



Thanks, for that info as well, I adopted it for my script.

Yours

lopiuh
 
 

Gesendet: Dienstag, 10. Januar 2017 um 14:32 Uhr
Von: "Greg Wooledge" <wooledg@eeg.ccf.org>
An: debian-user@lists.debian.org
Betreff: Re: Re: Bash different behaviour of read / strings in jessie versus stretch (regression?)
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.
 

Reply to: