can't reset it if not set up
[unix-history] / usr / src / old / gets / gets.1
CommitLineData
af566d2f
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\" @(#)gets.1 4.1 (Berkeley) %G%
6.\"
7.TH GETS 1 "4/1/81"
8.UC 4
9.SH NAME
10gets \- get a string from standard input
11.SH SYNOPSIS
12.B gets
13[ default ]
14.SH DESCRIPTION
15.B N.B.:
16This command was introduced for use in \fI.login\fR scripts when the facilities
17of the
18.IR tset (1)
19command were not totally adequate in setting the terminal type.
20This is no longer true, and
21.I gets
22should no longer be needed.
23To boot, a construct ``$<'' is available in
24.IR csh (1)
25now which has the functionality of
26.IR gets:
27.IP
28\fBset a=$<\fR
29.br
30\fBif ($a == '') set a=default
31.LP
32replaces
33.IP
34\fBset a=`gets default`\fR
35.LP
36Users of
37.IR sh (1)
38should use its
39.I read
40command rather than
41.I gets.
42.PP
43.I Gets
44can be used with
45.IR csh (1)
46to read a string from the standard input.
47If a
48.I default
49is given it is used if just return is typed, or if an error occurs.
50The resultant string (either the default or as read from the standard
51input is written to the standard output.
52If no
53.I default
54is given and an error occurs,
55.I gets
56exits with exit status 1.
57.SH "SEE ALSO"
58csh (1)
59.SH BUGS
60.I Gets
61is obsolete.