EXIT STATUS
Wget may return one of several error codes if it encounters problems.
0 No problems occurred.
1 Generic error code.
2 Parse error---for instance, when parsing command-line options, the .wgetrc or .netrc...
3 File I/O error.
4 Network failure.
5 SSL verification failure.
6 Username/password authentication failure.
7 Protocol errors.
8 Server issued an error response.
With the exceptions of 0 and 1, the lower-numbered exit codes take precedence over higher-numbered ones, when
multiple types of errors are encountered.
我们看下官方文档的说法:
再看看英语版:
实际上,这两种说法都容易引起歧义,正确的理解应该是
成功则返回命令的退出码
即
中的
code。大部分情况下,
exit(0)代表没有错误。然而这并不代表所有。具体的需要在对应命令下
man wget以下是结果:
所以等于0确实是代表成功,而等于1代表了出错。
你的文件真的下载成功了吗?
-1到底啥意思呢?
500M的文件?超时了吧