Simple question. In a cli script
Do you want to proceed?
If user says "no". Exit code must be 0? Or not and why?
Simple question. In a cli script
Do you want to proceed?
If user says "no". Exit code must be 0? Or not and why?
From the program perspective definitely it's 0. However I've written few scripts where the exit code was captured to explain the exit status of the program. In that case I've captured the system exit code and also assigned new exit codes for each options selected to inform the final status of the program execution. Hope this helps!