Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$? に遭遇しました。私が統合に取り組んでいるシェルスクリプトの1つで(私が書いたものではありません)。
前のコマンドの戻りコードを意味することを確認したかっただけです。
使用法は次のようなものです
runSomeCommand $VAR1 $VAR2 $VAR3 processResult $?
$?最後に実行されたコマンドの終了ステータスです。
$?
ls .... echo $? 0 $ ls notexistingfile ls: cannot access notexistingfile: No such file or directory echo $? 2