|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 767 (0x2ff) Types: TextFile Names: »shell.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki └─⟦this⟧ »EUUGD11/euug-87hel/sec1/shar/shell.c«
/* ** Stand-alone driver for shell. */ #include "shar.h" RCS("$Header: shell.c,v 1.4 87/03/24 16:19:56 rs Exp $") extern void SetVar(); main(ac, av) register int ac; register char *av[]; { char *vec[MAX_WORDS]; char buff[MAX_VAR_VALUE]; if (Interactive = ac == 1) { fprintf(stderr, "Testing shell interpreter...\n"); Input = stdin; File = "stdin"; } else { if ((Input = fopen(File = av[1], "r")) == NULL) SynErr("UNREADABLE INPUT"); /* Build the positional parameters. */ for (ac = 1; av[ac]; ac++) { (void)sprintf(buff, "%d", ac - 1); SetVar(buff, av[ac]); } } /* Read, parse, and execute. */ while (GetLine(TRUE)) if (Argify(vec)) (void)Exec(vec); /* That's it. */ exit(0); }