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