On Mon, 2017-05-29 at 11:37 -0500, dualbus wrote:
> On Mon, May 29, 2017 at 12:29:16AM -0400, George Caswell wrote:
> [...]
> >
> > Bash's builtin function "read" has one simple job: read data, return
> > it to the caller. There shouldn't be anything in there about executing
> > commands.
> >
> > Why does read even need a function like this? Is it something that was
> > useful in the days before job control? ##SELECTION_END##
> The -e flag causes read to use GNU Readline if the input comes from a
> terminal. This is *very* useful
You misunderstand. Being able to use Readline in "read" is great! And
"edit-and-execute-command" may have its uses when invoked from an interactive
shell session. But why is "edit-and-execute-command" useful or in any way
desirable in "read"?
If you were using "read -e" in a script, and someone wanted to run some
commands, they could suspend the script with job control, or open another
terminal window to run some commands. The feature is unnecessary, and has no
business being a part of "read".