Skip to content

Minor issue: exit in minishell behaves slightly different than in Bash #7

@linhtng

Description

@linhtng

Just for documentation, maybe not necessary to fix.

  • minishell$ exit | exit
    Don't exit minishell but will print exit
    bash-3.2$ exit | exit
    bash-3.2$
    Bash doesn't exit bash and won't print exit.
    This is probably because bash print exit to STDERROR

  • minishell$ exit > output
    Minishell: Exit and print exit to output.
    Bash: Printing exit to the shell and exit, output file is empty.

  • bash-3.2$ exit -9223372036854775809
    exit
    bash: exit: -9223372036854775809: numeric argument required
    c2r1p6% echo $?
    255
    minishell$ exit -9223372036854775809
    exit
    c2r1p6% echo $?
    0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions