kose-yusuke / minishell

1 stars 0 forks source link

`exit` コマンドの引数処理の修正 #108

Closed skitheom closed 1 month ago

skitheom commented 1 month ago

exit コマンドの引数処理の修正

概要

動作確認

bash の挙動

bash-3.2$ exit 3
bash-3.2$ echo $?
3

bash-3.2$ exit ' 11 '
bash: exit: 11: numeric argument required
bash-3.2$ echo $?
255

bash-3.2$ exit 9223372036854775808
bash: exit: 9223372036854775808: numeric argument required
bash-3.2$ echo $?
255

bash-3.2$ exit 11xyz
bash: exit: 11xyz: numeric argument required
bash-3.2$ echo $?
255

bash-3.2$ exit 11 notnumeric
bash: exit: too many arguments
bash-3.2$ echo $?
1

minishell の挙動

minishell$ exit 3
minishell$ echo $?
3

minishell$ exit ' 11 '
exit: numeric argument required
minishell$ echo $?
255

minishell$ exit 9223372036854775808
minishell$ echo $?
255

minishell$ exit 11xyz
exit: numeric argument required
minishell$ echo $?
255

minishell$ exit 11 notnumeric
exit: too many arguments
minishell$ echo $?
1

関連 issue