I want to make a very simple linux shell in c (one that will just run one program with any required arguments ) but th program is not working, i dont know why.
Code:void prompt() { printf("Console$ "); } int main() { while(1) { prompt(); char s[20]; int res_fork, status; fgets(s, sizeof(s), stdin); res_fork = fork(); if (res_fork==0) { execv (s, NULL); } else { wait(&status); } } }