Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit status #40

Closed
kurz-m opened this issue Nov 21, 2023 · 2 comments · Fixed by #47
Closed

Exit status #40

kurz-m opened this issue Nov 21, 2023 · 2 comments · Fixed by #47
Assignees
Labels
bug Something isn't working

Comments

@kurz-m
Copy link

kurz-m commented Nov 21, 2023

Get correct exit status

During testing, I encountered some inconsistencies regarding the exit status code.

minishell: syntax error near unexpected token |
minishell> echo $?
258

This should not give 258 as return value. It should return 2

ctrl+c returns 0 as exit status, but should return 130.

minishell> "
minishell: unclosed quotes 
minishell> echo $?
0

returns 0 as exit status but should also return 2.

@RealConrad
Copy link
Owner

Thank you! We will look into it :D

@RealConrad RealConrad added the bug Something isn't working label Nov 21, 2023
@kurz-m
Copy link
Author

kurz-m commented Nov 21, 2023

Addition

You actually have the correct exit code when using ctrl+c in a blocking child command:

minishell> cat
# pressing ctrl+c
minishell> echo $?
130

Calling the cat command and then pressing ctrl+c gives the correct exit status of 130.

@RealConrad RealConrad linked a pull request Nov 24, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants