This repository has been archived by the owner on Jul 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Count Errors & Exit With Error Count
- Loading branch information
Showing
3 changed files
with
18 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is incorrect.
in shell, the exit value is a number between 0 and 255 (inclusive). This is a modulo 256 computation. Hence if the number of errors happens to be a multiple of 256, it would return 0 and be seen as no error occurred
You can test it simply by running the following script:
and then run the script with different values like 0, -1, 255, 256, 257, 512 ...
edit: nevermind: I just saw now that there the counter wouldn't be incremented above 254, hence this bug is not present. Sorry