redhat man page for gets

Query: gets

OS: redhat

Section: n

Links: redhat man pages   all man pages

Forums: unix linux community   forum categories

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

gets(n) 						       Tcl Built-In Commands							   gets(n)

__________________________________________________________________________________________________________________________________________________

NAME
gets - Read a line from a channel
SYNOPSIS
gets channelId ?varName? _________________________________________________________________
DESCRIPTION
This command reads the next line from channelId, returns everything in the line up to (but not including) the end-of-line character(s), and discards the end-of-line character(s). If varName is omitted the line is returned as the result of the command. If varName is specified then the line is placed in the variable by that name and the return value is a count of the number of characters returned. If end of file occurs while scanning for an end of line, the command returns whatever input is available up to the end of file. If chan- nelId is in nonblocking mode and there is not a full line of input available, the command returns an empty string and does not consume any input. If varName is specified and an empty string is returned in varName because of end-of-file or because of insufficient data in non- blocking mode, then the return count is -1. Note that if varName is not specified then the end-of-file and no-full-line-available cases can produce the same results as if there were an input line consisting only of the end-of-line character(s). The eof and fblocked commands can be used to distinguish these three cases.
SEE ALSO
file(n), eof(n), fblocked(n)
KEYWORDS
blocking, channel, end of file, end of line, line, nonblocking, read Tcl 7.5 gets(n)
Related Man Pages
gets(n) - mojave
gets(ntcl) - mojave
gets(3) - plan9
gets(3) - x11r4
gets(3) - xfree86
Similar Topics in the Unix Linux Community
Need to serach if a new line character exists on the last line in a file
need help asap
Replace end of line with a space
Why is required to leave an empty line at the end of a C program?
Reading a file after nth line