help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] multiline random paste or how to properly use (named) st


From: Greg Wooledge
Subject: Re: [Help-bash] multiline random paste or how to properly use (named) streams
Date: Tue, 13 Mar 2018 13:47:47 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Tue, Mar 13, 2018 at 12:57:45PM -0400, Greg Wooledge wrote:
> while true; do
>     # Read 1-5 lines from first file.
>     n=$((1 + RANDOM%5))
>     for ((i=1; i<=n; i++)); do
>       IFS= read -r line <&3 || break

Both of these "break" commands should have been "break 2".  Sorry 'bout
that.  Also, the script as written is completely untested, so there
could be other bugs lurking.



reply via email to

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