* man - intelligent man command
* Author: Bill Joy UCB August 25, 1977
* Man is an intelligent man command which obviates the need to know
* section numbers in the manual. Also if the standard output is a teletype and
* the option - is not given we pipe through "ssp" to eliminate piled
int i
, pvec
[2], section
, io
, tty
[3];
io
= open("/usr/adm/manlog", 1);
if (io
> 0 && fork() == 0) {
if (getpw(getuid(), buf
))
for (cp
= buf
; *cp
&& *cp
!= ':'; cp
++)
printf("%c %-8s man", ttyn(1), buf
);
for (i
= 1; i
<= argc
; i
++)
if (chdir("/usr/man") < 0) {
printf("Can't chdir to /usr/man\n");
printf("Usage: man [ section ] name ...\n");
execl("/usr/pascal/ssp", "ssp", 0);
execl("/bin/ssp", "ssp", 0);
execl("/usr/bin/ssp", "ssp", 0);
printf("Can't find ssp!\n");
execl("/bin/cat", "cat", 0);
printf("or cat - gott in himmel!\n");
if (argv
[0][0] >= '0' && argv
[0][0] <= '9' && !argv
[0][1]) {
section
= argv
[0][0] - '0';
printf("But what do you want from section %s?\n", argv
[-1]);
manual(section
, argv
[0]);
for (section
= '1'; section
<= '9'; section
++) {
if (stat(work
, stbuf
) >= 0)
printf("No section in the manual has %s in it\n", name
);
work
[last
] = section
+ '0';
if (stat(work
, stbuf
) < 0) {
printf("%s is not in section %d of the manual\n", name
, section
);
printf("No more processes\n");
donroff("/bin/nroff", cp
);
donroff("/usr/bin/nroff", cp
);
printf("Can't find a nroff - come again\n");
execl(nis
, "nroff", "-h", "man0/naa", what
, 0);
register char *to
, *from
;
register char *after
, *with
;