From: "David J. Fiander" <david@golem.uucp>
To: dws@cs.wisc.edu (DaviD W. Sanderson)
Cc: The rc user community <rc@archone.tamu.edu>
Subject: Re: A lighter read function
Date: Wed, 11 Dec 1991 06:28:26 -0600 [thread overview]
Message-ID: <22832.692454506@golem.UUCP> (raw)
In-Reply-To: Your message of "Tue, 10 Dec 91 23:32:36 EST." <9112110432.AA18495@skinner.cs.wisc.edu>
>> exactly the same functionality as the example source, except it
>> uses line(1) and doesn't do the assignment if the read fails.
>
>line(1) is not available everywhere. At least not on the 4.3BSD-utah
>systems I use. Perhaps rephrasing in terms of `sed 1q' would be better.
Try 'david%golem@lsuc.on.ca'. True, but the problem with sed
is that it doesn't fail on EOF, which is true of line.
line is available on all SCO UNIX systems, and I first saw it
on a BSD 4.2 system (I think). Besides it is easily written:
#include <stdio.h>
main(argc, argv)
int argc;
char **argv;
{
char buf[256];
int len;
if (fgets(buf, sizeof(buf), stdin) == (char *)NULL) {
fputs(buf, stdout);
exit(0);
} else
exit(1);
}
next prev parent reply other threads:[~1991-12-11 12:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-12-11 4:32 DaviD W. Sanderson
1991-12-11 12:28 ` David J. Fiander [this message]
1991-12-11 19:28 ` Chris Siebenmann
1991-12-13 0:58 ` David J. Fiander
1991-12-13 1:37 ` Chris Siebenmann
1991-12-13 1:47 ` David Hogan
1991-12-11 21:48 ` Ronald S H Khoo
1991-12-12 12:16 ` David J. Fiander
-- strict thread matches above, loose matches on Subject: below --
1991-12-11 3:53 David J. Fiander
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22832.692454506@golem.UUCP \
--to=david@golem.uucp \
--cc=dws@cs.wisc.edu \
--cc=rc@archone.tamu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).