bash - exit status in shell script -


I am running an application form shell script now I know that it is usually out of or unusual (accident etc) Wants to know the exit status of the application to get out. How do I know this? Example: ./mytestApp

$? In the the last out-of-order command is executed. Therefore, if the last command is ./ mytestapp , $? will immediately include the situation outside of it (note that you can only recover this value once and it should be re-instantly received, after which the condition of the command you want to know). You might want to capture it in a variable, eg

  #! / Bin / bash ./mytestappappspcc = $? Continue what you are doing   

All of this assumes that you bash (sh and zsh will also work as IIRC).

Comments

Popular posts from this blog

qt - switch/case statement in C++ with a QString type -

python - sqlite3.OperationalError: near "REFERENCES": syntax error - foreign key creating -

Python's equivalent for Ruby's define_method? -