If I try downloading a file which already exists with wget using the --no-clobber option, it works as expected but the exit code is 1 which is crashing my scripts. Why is the exit code 1 and how can I work around it?
$ wget -nc --continue --output-document "/User/Downloads/download.txt" "https://example.com/download.txt"
File ‘/User/Downloads/download.txt’ already there; not retrieving.
$ echo $?
1
-ncand perform the check yourself.--continueand--no-clobbertogether? On one hand, you want to continue a transfer, by on the other you don't want to modify the document if it exists?