CREAR UN PROGRAMA QUE SIMULE UN SHELL

 

#include <stdio.h>

#include <stdlib.h>
int main (void)
{
  char * command = "ps -aux  ";
  int cmd = system( command );
  if( cmd == -1 ) { printf( "Error al inicializar el comando en el sistema.\n"); }
  else if( cmd > 0 )   { printf( "valor de retorno de comandos  %d.\n", cmd ); }
  else  printf( "success\n" );
  return 0;
}