Retourner au contenu associé (entrée de forum : récupérer le status en sortie d'un applicatif dans un shell)
Posté par Axioplase ıɥs∀ (site web personnel) le 18 août 2009 à 12:12. En réponse au message récupérer le status en sortie d'un applicatif dans un shell. Évalué à 3.
% cat toto.cpp #include using namespace std; int main (int argc, char *argv[]) { int exitValue = 42; cout << "exitValue : " << exitValue << endl; exit(exitValue); } % g++ toto.cpp -o toto % ./toto exitValue : 42 % echo $? 42 %
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# ChezmoiçamarcheTM
Posté par Axioplase ıɥs∀ (site web personnel) . En réponse au message récupérer le status en sortie d'un applicatif dans un shell. Évalué à 3.
% cat toto.cpp
#include
using namespace std;
int main (int argc, char *argv[]) {
int exitValue = 42;
cout << "exitValue : " << exitValue << endl;
exit(exitValue);
}
% g++ toto.cpp -o toto
% ./toto
exitValue : 42
% echo $?
42
%