home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Super PC 34
/
Super PC 34 (Shareware).iso
/
spc
/
UTIL
/
DJGPP2
/
V2
/
DJTST200.ZIP
/
tests
/
libc
/
ansi
/
stdlib
/
shell.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
TIS-620 (detected)
UTF-8
Wrap
C/C++ Source or Header
|
1995-08-05
|
421 b
|
24 lines
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
int
main(void)
{
char line[2000];
int rv;
while (1)
{
printf("$ ");
fflush(stdout);
if (fgets(line, 2000, stdin) == 0)
break;
line[strlen(line)-1] = 0;
printf("line = `%s'\n", line);
rv = system(line);
/* rv = spawnlp(P_WAIT, line, line, 0); */
printf("══%c %d\n", 16, rv);
}
return 0;
}