GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting
Go To First  |  Previous Question  |  Next Question 
 Shell Scripting  |  Question 6 of 47    Print  
What does $? return?

  
Total Answers and Comments: 5 Last Update: March 30, 2007   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
June 02, 2005 07:28:14   #1  
Muthu        

RE: What does $? return?
Will return the status of the command which is executed lastly.
0 > Success
2 > Error

 
Is this answer useful? Yes | No
January 25, 2006 15:14:41   #2  
sumit01_77 Member Since: December 2005   Contribution: 27    

RE: What does $? return?
just to add above0 for success and any number other than 0 is for failure Ashish
 
Is this answer useful? Yes | No
February 27, 2006 00:12:53   #3  
       

RE: What does $? return?
$? will return exit status of command .0 if command gets successfully executed non-zero if command failed.
 
Is this answer useful? Yes | No
March 28, 2007 07:39:57   #4  
Rajeesh        

RE: What does $? return?
it will return the exit status of the last command that executed.. 0 means last command was a success and 1 or any other no means it was a failure.thats it...
 
Is this answer useful? Yes | No
March 30, 2007 17:57:57   #5  
Chiranjeevi Manne        

RE: What does $? return?
It returns the exit status of the previously executed command.

if it is '0' then success otherwise fail.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape