* Copyright (c) 1983, 1988 Regents of the University of California.
* %sccs.include.redist.c%
"@(#) Copyright (c) 1983, 1988 Regents of the University of California.\n\
static char sccsid
[] = "@(#)hostname.c 5.4 (Berkeley) %G%";
char hostname
[MAXHOSTNAMELEN
], *p
, *index();
while ((ch
= getopt(argc
, argv
, "s")) != EOF
)
fputs("hostname [-s] [hostname]\n", stderr
);
if (sethostname(*argv
, strlen(*argv
))) {
if (gethostname(hostname
, sizeof(hostname
))) {
if (sflag
&& (p
= index(hostname
, '.')))