help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Sustitute to bash read or util-linux line in pure bash?


From: Garreau\, Alexandre
Subject: Re: [Help-bash] Sustitute to bash read or util-linux line in pure bash?
Date: Tue, 13 Mar 2018 19:20:02 +0100
User-agent: Gnus (5.13), GNU Emacs 25.1.1 (x86_64-pc-linux-gnu)

On 2018-03-13 at 13:01, Greg Wooledge wrote:
> On Tue, Mar 13, 2018 at 04:50:37PM +0100, Garreau, Alexandre wrote:
>> I learned using read to split in lines is considered bad practive
>> because of unportability and IFS stuff,
>
> Who told you this lie?  Or perhaps the question is really, What was
> the CONTEXT in which someone told you "don't do that"?

By doing research on how to do proper redirections while processing text
in a shell loop with read I did end on these two stackexchange posts [0]
[1] from Stéphane Chazelas. I think the main points here are about
portability, and, maybe, since you confirm it, more of readability and
complexity to use without error, than any other problem.

> What are you actually trying to do?
>
> What problem did you run into (or were you warned against) when you
> used read to read your input?

I recently posted on this list a message [2] where I explore a problem
using a read loop.

[0] Why is using a shell loop to process text considered bad practice? -
Unix & Linux Stack Exchange <https://unix.stackexchange.com/a/169765>

[1] bash - Understanding "IFS= read -r line" - Unix & Linux Stack
Exchange <https://unix.stackexchange.com/a/209184>

[2] [Help-bash] multiline random paste or how to properly use (named)
streams <address@hidden>



reply via email to

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