xref: /original-bsd/old/gets/gets.1 (revision 53787e02)
Copyright (c) 1980 Regents of the University of California.
All rights reserved. The Berkeley software License Agreement
specifies the terms and conditions for redistribution.

@(#)gets.1 4.1 (Berkeley) 04/29/85

GETS 1 "4/1/81"
C 4
NAME
gets - get a string from standard input
SYNOPSIS
gets [ default ]
DESCRIPTION
N.B.: This command was introduced for use in .login scripts when the facilities of the tset (1) command were not totally adequate in setting the terminal type. This is no longer true, and gets should no longer be needed. To boot, a construct ``$<'' is available in csh (1) now which has the functionality of gets:
set a=$<

if ($a == '') set a=default

replaces

set a=`gets default`

Users of sh (1) should use its read command rather than gets.

Gets can be used with csh (1) to read a string from the standard input. If a default is given it is used if just return is typed, or if an error occurs. The resultant string (either the default or as read from the standard input is written to the standard output. If no default is given and an error occurs, gets exits with exit status 1.

"SEE ALSO"
csh (1)
BUGS
Gets is obsolete.