#include <stdio.h>

#define BUFSIZE 80

void main() {
  /* simulate a shell:  read in a command from keyboard  */
  /* and send it to shell for execution  */

  char buf [BUFSIZE] ;
  int nc ;
  while ( fgets(buf, BUFSIZE,stdin ) != 0) {
    if (strlen(buf) == 0)
      exit(0);
    printf( "\nEntered:%s\n", buf ) ;
    nc =   system( buf ) ;
    printf(" Return code of system: %d\n",nc ) ;
  }
}

