empty return for function giving back status 1

this returned status 1
this return status 0
something happened between here
this return 1 also
return 0 status

seems like a empty return, returns the last status. question is how was the status set to 1? It happened in the condition,

since the condition was wrong it return 1, since return is empty it returned the last status. to fix, return 0;

also, the same logic applys to exit

lets say $status is equal to “0”, because the following condition is wrong and is 0 is not greater than 0, the following exits with status of 1;

so at the end of all my scripts I add this. If you made it to the end, everything has to be all good. so exit with 0;

Leave a Reply

Your email address will not be published.