Skip to content

execute_cmd.c

Jake Hamby edited this page Jul 9, 2022 · 1 revision

execute_cmd.c

Global state (same order as in .c)

  • stdin_redir - bool

    • set to 1 if fd 0 was redirected to a subshell.
    • reset to 0 by reader_loop before executing a command.
  • this_command_name - char*

    • name of the command currently being executed.
  • the_printed_command_except_trap - char*

    • same as the_printed_command except during trap.
    • useful for debugging

State-changing functions

  • shell_execve(char *command, char **argv, char **env)

  • static initialize_subshell(void)

    • delete_all_aliases();
    • history_lines_this_session = 0;
    • without_job_control();
    • reset_shell_flags();
    • reset_shell_options();
    • reset_shopt_options();
    • TODO: more
Clone this wiki locally