From howardjp@wam.umd.edu Wed Aug 11 05:21:57 1999
Return-Path: <howardjp@wam.umd.edu>
Received: from majordomo2.umd.edu (majordomo2.umd.edu [128.8.10.7])
	by hub.freebsd.org (Postfix) with ESMTP id 7EE4714DF5
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 1999 05:21:55 -0700 (PDT)
	(envelope-from howardjp@wam.umd.edu)
Received: from rac10.wam.umd.edu (root@rac10.wam.umd.edu [128.8.10.150])
	by majordomo2.umd.edu (8.9.3/8.9.3) with ESMTP id IAA00430
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 1999 08:20:55 -0400 (EDT)
Received: from rac10.wam.umd.edu (sendmail@localhost [127.0.0.1])
	by rac10.wam.umd.edu (8.9.3/8.9.3) with SMTP id IAA04663
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 11 Aug 1999 08:20:55 -0400 (EDT)
Received: (from howardjp@localhost)
	by rac10.wam.umd.edu (8.9.3/8.9.3) id IAA04659
	for FreeBSD-gnats-submit@freebsd.org; Wed, 11 Aug 1999 08:20:55 -0400 (EDT)
Message-Id: <199908111220.IAA04659@rac10.wam.umd.edu>
Date: Wed, 11 Aug 1999 08:20:55 -0400 (EDT)
From: James Howard <howardjp@wam.umd.edu>
Reply-To: howardjp@wam.umd.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: line(1) as required by Unix 98
X-Send-Pr-Version: 3.2

>Number:         13070
>Category:       bin
>Synopsis:       line(1) as required by Unix 98
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sheldonh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 11 05:30:00 PDT 1999
>Closed-Date:    Mon Dec 20 08:14:21 PST 1999
>Last-Modified:  Mon Dec 20 08:15:02 PST 1999
>Originator:     James Howard
>Release:        FreeBSD 3.2-STABLE i386
>Organization:
University of Maryland
>Environment:

FreeBSD byzantine 3.2-STABLE FreeBSD 3.2-STABLE #5: Sat Aug  7 23:43:54 GMT 1999     root@byzantine:/usr/src/sys/compile/BYZANTINE  i386

>Description:

After opening my big mouth on freebsd-advocacy about how Unix 98
compliance was a worthy goal, more than one person told me to go
ahead and send in PRs with changes.  Well, here is one :)

This contains a shar of line(1).  It reads in one line of text 
up to and including a new line and prints it to the standard output.  
It has been depreciated in Unix 98 and will probably be removed in 
the next edition of the standard.

>How-To-Repeat:

Irrelevant.

>Fix:
	
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	Makefile
#	line.1
#	line.c
#
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
XPROG=line
X
X.include <bsd.prog.mk>END-of-Makefile
echo x - line.1
sed 's/^X//' >line.1 << 'END-of-line.1'
X.\" Copyright (c) 1999 James Howard
X.\" All rights reserved.
X.\"
X.\" Redistribution and use in source and binary forms, with or without
X.\" modification, are permitted provided that the following conditions
X.\" are met:
X.\" 1. Redistributions of source code must retain the above copyright
X.\"    notice, this list of conditions and the following disclaimer.
X.\" 2. Redistributions in binary form must reproduce the above copyright
X.\"    notice, this list of conditions and the following disclaimer in the
X.\"    documentation and/or other materials provided with the distribution.
X.\"
X.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X.\" SUCH DAMAGE.
X.\"
X.\"
X.\"     $Id$
X.\"
X.Dd August 9, 1999
X.Dt LINE 1
X.Os
X.Sh NAME
X.Nm line
X.Nd read and output one line
X.Sh SYNOPSIS
X.Nm
X.Sh DESCRIPTION
XThe 
X.Nm
Xutility reads one line text up to and including a 
Xnew line from the standard input and prints that line
Xto the standard output.  It always prints at least
Xa new line.
X.Pp
XThis utility has been depreciated and users should
Xmigrate to the 
X.Xr read 1
Xutility.
X.Sh DIAGNOSTICS
XThe 
X.Nm
Xutility returns 1 if an end of file condition is 
Xreached on the standard input; 0 is returned otherwise.
X.Sh SEE ALSO
X.Xr csh 1 ,
X.Xr sh 1
X.Sh STANDARDS
XThe
X.Nm
Xutility is expected to be XPG5 compliant.
END-of-line.1
echo x - line.c
sed 's/^X//' >line.c << 'END-of-line.c'
X/*-
X * Copyright (c) 1999 James Howard
X * All rights reserved.
X *
X * Redistribution and use in source and binary forms, with or without
X * modification, are permitted provided that the following conditions
X * are met:
X * 1. Redistributions of source code must retain the above copyright
X *    notice, this list of conditions and the following disclaimer.
X * 2. Redistributions in binary form must reproduce the above copyright
X *    notice, this list of conditions and the following disclaimer in the
X *    documentation and/or other materials provided with the distribution.
X *
X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
X * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
X * SUCH DAMAGE.
X *
X *      $Id$
X */
X
X#include <stdio.h>
X
X/*
X * An XPG5 compliant implementation of line(1).  The line utility reads a
X * line of text from the standard input and prints it to the standard output.
X */
X
Xint
Xmain(void)
X{
X	char *l;
X	int   len;
X
X	/* Grab a line and print it. */
X	l = fgetln(stdin, &len);
X	(void) fwrite(l, len, 1, stdout);
X
X	/*
X	 * Check for the special condition that EOF was encountered on the
X	 * standard input and that a newline was not the last character in
X	 * the buffer.  If it is not, print one.
X	 */
X	if (l[len - 1] != '\n')
X		fputc('\n', stdout);
X
X	/*
X	 * Find out if we received EOF on the standard input and return that
X	 * as the exit status.
X	 */
X	return feof(stdin);
X}
END-of-line.c
exit




>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Wed Sep 8 07:02:18 PDT 1999 
Responsible-Changed-Why:  
James and I are discussing PR 13070, PR 13071 and PR 13074, which are 
all related. 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Mon Dec 20 08:14:21 PST 1999 
State-Changed-Why:  
This one won't be incorporated into FreeBSD, since the utility 
is flagged as "legacy" in the standard. 
>Unformatted:
