GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Operating System  >  Shell Scripting

 Print  |  
Question:  Shell Scripting Commands

Answer: In shell scripting How to indentify that the previous command was run successfully?


May 05, 2009 05:48:35 #1
 garima2k1   Member Since: May 2009    Total Comments: 1 

RE: Shell Scripting Commands
 
If a command is executed successfully then the exit status of a command is 0. We can test whether a command is execute successfully or not by writing 2 line

[ command_name ]       # command_name is any unix command
echo $?       

 #  $? contains success/failure of the last command that has been executed
     

 

Back To Question