Need the difference between exit 1 & exit 7

Hi

In one of the script I am seeing some thing like exit 7,exit 1,exit 2,exit 3,exit 9,exit6.What is the difference between all of this exit.Can anyone help here please

The numbers are simply values that are being returned to the invoking process. What those particular numbers mean is implementation dependent except for 0 which means SUCCESS.

An exit command upon terminating a script can also return a value to the parent script.

Usually SUCCESS is indicated by zero and FAILURE is indicated by non-zero exit codes.

As far I know an exit status should be an integer in 0 - 255 range. Out of which there are few exit codes with special meanings.

By the way we can program a script to return certain exit codes (in your case 1,2,3,6..) for different scenarios which will be available to parent and the parent can be programmed to handle each scenarios differently.

So there will be different set of actions taken when script returns 1,2,3,6 etc.

0 means success, any nonzero number means some sort of error. There's no rigid standard for which number means what error, that's up to the program, but returning different numbers allows whatever calls it to tell the different errors apart.