Exit code should exclusively be 0 or 1, and not 1 if -O is used and 0 if -O isn't used. Code fixed here: https://github.com/ProximaNova/gnu-wget
Which says: " With the mainsteam Wget, if the file already exists: * WGET_EXIT_SUCCESS (exit code 0) from wget -nc https://example.com/ * WGET_EXIT_GENERIC_ERROR (exit code 1) from wget -nc https://example.com/ -O index.html With this edit to Wget, if the file already exists: * WGET_EXIT_GENERIC_ERROR (exit code 1) from wget -nc https://example.com/ * WGET_EXIT_GENERIC_ERROR (exit code 1) from wget -nc https://example.com/ -O index.html " Related: - https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=clobber+exit+code&submit=Search%21&idxname=bug-wget&max=20&result=normal&sort=score - https://lists.gnu.org/archive/html/bug-wget/2018-07/msg00036.html