Closed skitheom closed 1 month ago
exit コマンドの引数処理の修正
exit
11xyz
9223372036854775808
numeric argument required
255
exit 11 notnumeric
too many arguments
1
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$ 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
exit
コマンドの引数処理の修正概要
11xyz
や9223372036854775808
)numeric argument required
エラーを表示exit
を実行し、終了ステータスを255
に設定exit 11 notnumeric
)too many arguments
エラーを表示exit
を実行せず、終了ステータスを1
に設定動作確認
bash の挙動
minishell の挙動
関連 issue