Closed TetsuOtter closed 1 year ago
$?でexit statusの展開を行えるようにしました
$?
minishell> echo $? 0 minishell> grep usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] minishell> echo $? 2 minishell> bash -c 'exit 3' minishell> echo $? 3 minishell> bash -c 'exit 3' || echo $? 3 minishell> bash -c 'exit 1' || echo $? 1 minishell> bash -c 'exit 255' || echo $? 255 minishell> bash -c 'exit 256' || echo $? minishell> bash -c 'exit 257' || echo $? 1 minishell> bash -c 'exit 257' |grep || echo $? usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]] [-e pattern] [-f file] [--binary-files=value] [--color=when] [--context[=num]] [--directories=action] [--label] [--line-buffered] [--null] [pattern] [file ...] 2 minishell>
$?
でexit statusの展開を行えるようにしました