35 ft_putstr_fd(
"exit\n", STDERR_FILENO);
41 exit_code = ft_atoll(args[1], &overflow);
42 if (!ft_str_is_numeric(args[1]) || overflow)
44 ft_putstr_fd(
"minishell: exit: ", STDERR_FILENO);
45 ft_putstr_fd(args[1], STDERR_FILENO);
46 ft_putstr_fd(
": numeric argument required\n", STDERR_FILENO);
50 if (ft_arrlen(args) > 2)
51 return (ft_putstr_fd(
"minishell: exit: too many arguments\n",
54 return ((
unsigned char)exit_code);
int builtin_exit(char **args, t_shell *shell)
Implement the exit command.
Shell builtin commands prototypes.
int interactive
1 if STDIN is a tty
int running
1 while main loop is active
int exit_status
Last command's exit status.