LINEOUT( )
Returns the number of lines remaining after positioning the stream streamid to the start of line line and writing out string as a line of text.
LINEOUT([streamid][,[string][,line]])
If streamid is omitted, the default output stream is used. If line (must be a positive whole number) is omitted, the stream will not be repositioned before the write. If string is omitted, nothing is written to the stream. If string is specified, a system-specific action is taken after it has been written to stream to mark a new line.
If string is specified but not line, string is written to the stream starting at the current write position. If line is specified but not string, the stream is positioned in the new position.
The line parameter is only valid for persistent streams. If line is specified for a transient stream, an error is issued. The current write position cannot be used for transient streams. If neither line nor string is specified, the standard requires that the current write position is set to the end of the stream and implementation-specific side effects may occur. In practice, this means that an implementation can use this situation to do things like closing the stream or flushing the output. Note that if string should be written to a line in the middle of the stream (i.e. line is less than the total number of lines in the stream), the behavior is system- and implementation-specific. Some systems will truncate the stream after the newly written line, others will only truncate if the newly written line has a different length than the old line that it replaced, and yet other systems will overwrite and never truncate.
Examples
LINEOUT(,'First line')
LINEOUT('/tmp/file','Second line',2)
LINEOUT('/tmp/file','Third line')
LINEOUT('/tmp/file','Fourth line',4)