.. include:: ../header.txt .. _read: :command:`read` =========================== .. index:: read :title:`Linux for Programmers and Users`, Sections 6.3.7 .. program:: read .. describe:: read The ``read`` command is useful for reading data into a variable and as the boolean *test* of a :ref:`control`. Like :ref:`test`, ``read`` sets the :ref:`exit` to indicate if a value was read. When the end-of-file (EOF) character is read, it sets the :ref:`exit` to *false*, so it works well with a :ref:`while` when standard input is redirected to read from a file. SYNOPSIS :command:`read` variable Examples:: echo -n "Please enter your name: " read name echo "Your name is $name" :: while read line do echo $line done