The standard read
utility takes at least one variable's name.
Some shell's read
implementation uses a default variable, like REPLY
, to store the read data if no name is supplied, but dash
, aiming to be a POSIX compliant shell, does not (as it's not required to do so by the standard). The equivalent in the dash
shell would be
read REPLY
The bash
shell, even in its POSIX mode, does keep some non-POSIX features enabled. This is one of them, which means that read
with no variable's name will work even if you run a bash --posix
shell.
For a full list of things that happens when you enable POSIX mode in bash
(which this question really isn't about), see https://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html
type read
plus Return ... and if the output says something about a built-in you probably have the explanation right there. Other possible outputs would be the path to some binary, a function of the name or an alias of the name (hope I didn't forget one). According to thedash
man page you haveshell functions, builtin commands, and normal programs
there. The builtincommand
would allow you to refer to the command (e.g./bin/read
) ... simply saycommand read
. – 0xC0000022L Apr 20 '20 at 21:08