1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
$codigo = '#include <sys/types.h> #include <unistd.h> #include <stdio.h> int main(int argc, char *argv[]){ pid_t pid1; int status1; int numero=6; if ( (pid1=fork()) == 0 ){ /* hijo */ numero +=5; printf(\"Soy el hijo Valor variable %d \\n\",numero); }else{ /* padre */ numero -=5; printf(\"Soy el padre Valor variable %d \\n\",numero); } return 0; }' wsl echo $codigo > hola.c bash -c "iconv hola.c -f UTF-16 -t UTF-8 > holas.c" wsl gcc holas.c wsl "./a.out" |