Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, how do you print out the exit/error code of the last command that was executed?
Answer

echo $?

^^ note that $ denotes variable expansion, and ? is special variable to represent exit code of last command/program executed in foreground.


Question
In linux, how do you print out the exit/error code of the last command that was executed?
Answer
?

Question
In linux, how do you print out the exit/error code of the last command that was executed?
Answer

echo $?

^^ note that $ denotes variable expansion, and ? is special variable to represent exit code of last command/program executed in foreground.

If you want to change selection, open document below and click on "Move attachment"

20. Advanced Shell Scripting
int: this is very useful for writing wrapper shell scripts that just add one argument.] $# Expands to the number of positional parameters in decimal (i.e. the number of command-line arguments). <span>$? Expands to the status of the most recently executed foreground pipeline. [I.e., the exit code of the last command.] $- Expands to the current option flags as specified upon invocation,

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.