sophiakoulen / minishell

A simplified bash-like shell, with pipes, redirections and variable expansion.
4 stars 1 forks source link

exit return code #45

Closed znichola closed 1 year ago

znichola commented 1 year ago
int exec_exit(char **args)
{
    (void)args;
    // cleanup functions? idk really.
    // TODO: return the correct exit code, from the last run command
    exit(0);
}
znichola commented 1 year ago

and !!!!

bash-3.2$ exit 123
exit
➜  minishell git:(builtin-connection) ✗ echo $?
123
znichola commented 1 year ago

but this doesn't fix the exit code from the last command being piped in, so re opening

znichola commented 1 year ago

fixed with recent changes