Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ line(1) — UTek 3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

sh(1sh)

read(2)

select(2)



LINE(1)                 COMMAND REFERENCE                 LINE(1)



NAME
     line - read one line

SYNOPSIS
     line [ timeout ]

DESCRIPTION
     Line copies one line (up to a newline) from the standard
     input and writes it on the standard output.  It returns an
     exit code of 1 on EOF and always prints at least a new-line.
     It is often used within shell files to read from the user's
     terminal.

     The timeout argument is an integer which specifies the
     maximum time in seconds to wait for input.  If no input is
     given in that amount of time, line exits with a code of 1.

EXAMPLES
     The following is a shell script that asks the user for a
     file name and prints the contents of the script.  When the
     user types an end-of-file, the script exits.

          #!/bin/sh
          while true
          do
               Name=`line`
               if [ $? != 0 ]
               then
                    exit 0
               fi
               cat "$Name"
          done

     The following is a shell script that waits for the user to
     type something, reminding him that it is waiting every 10
     seconds.

          #!/bin/sh
          while true
          do
               if line 0
               then
                    exit 0
               fi
               echo "\007Waiting for response"
          done

RETURN VALUE
     [NO_ERRS]      Command completed without error.

     [USAGE]        Incorrect command line syntax. Execution
                    terminated.



Printed 5/12/88                                                 1





LINE(1)                 COMMAND REFERENCE                 LINE(1)



     [1]            End-of-file reached or timeout with no input
                    data.

     [NP_ERR]       An error occurred that was not a system
                    error.  Execution terminated.

     [P_ERR]        A system error occurred. Execution
                    terminated.  See intro(2) for more
                    information on system errors.

SEE ALSO
     sh(1sh), read(2), and select(2).











































Printed 5/12/88                                                 2





































































%%index%%
na:240,72;
sy:312,166;
de:478,708;
ex:1186,834;
rv:2020,270;2602,376;
se:2978,191;
%%index%%000000000116

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026