Jump to content

Recommended Posts

Posted
Exit Status:
 
By default in Linux if particular command/shell script is executed, it return two type of values which is used to see whether command or shell script executed is successful or not.

 

(1) If return value is zero (0), command is successful.
(2) If return
value is nonzero
, command is not successful or some sort of error executing command/shell script.

 

          This value is known as Exit Status.

 

to find out exit status of command or shell script – use $? special variable of shell.
 
$ echo $?
if it print nonzero value, to indicate an error.
 
$ echo $?
If it print 0, for indicating that the command is successful.
 
  • Replies 120
  • Created
  • Last Reply

Top Posters In This Topic

  • SamosaChai

    42

  • pinky123

    16

  • HECTOR08

    14

  • king420

    11

×
×
  • Create New...