分页: 1 / 1

wget 用了-q参数,怎么还会生成wget-log文件?

发表于 : 2018-04-30 15:06
haime
命令如下:

代码: 全选

wget http://2017.ip138.com/ic.asp -q -O - |
grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>'
在shell文集里面允许上面的命令会在用户目录生成一个wget-log的空文件。
为什么呀?还有个问题就是-O后面的-是什么意思?

Re: wget 用了-q参数,怎么还会生成wget-log文件?

发表于 : 2018-04-30 19:35
poloshiao
-O后面的-是什么意思?
https://www.gnu.org/software/wget/manua ... ad-Options
2.5 Download Options
‘-O file’
If ‘-’ is used as file, documents will be printed to standard output, disabling link conversion.

Re: wget 用了-q参数,怎么还会生成wget-log文件?

发表于 : 2018-05-01 9:06
haime
poloshiao 写了:
-O后面的-是什么意思?
https://www.gnu.org/software/wget/manua ... ad-Options
2.5 Download Options
‘-O file’
If ‘-’ is used as file, documents will be printed to standard output, disabling link conversion.
那个wget-log文件怎么回事?

Re: wget 用了-q参数,怎么还会生成wget-log文件?

发表于 : 2018-05-01 12:35
poloshiao
那个wget-log文件怎么回事?
1. 猜猜看

1-1. -q 關閉輸出
1-1-1. https://www.gnu.org/software/wget/manua ... le-Options
2.4 Logging and Input File Options
‘-q’
‘--quiet’
Turn off Wget’s output.

1-2. -O - 傳送到 標準輸出
1-2-1. https://www.gnu.org/software/wget/manua ... ad-Options
‘-O file’
If ‘-’ is used as file, documents will be printed to standard output, disabling link conversion.

1-3. 你猜 最後 哪個生效 ?

Re: wget 用了-q参数,怎么还会生成wget-log文件?

发表于 : 2018-05-06 10:37
haime
poloshiao 写了:
那个wget-log文件怎么回事?
1. 猜猜看

1-1. -q 關閉輸出
1-1-1. https://www.gnu.org/software/wget/manua ... le-Options
2.4 Logging and Input File Options
‘-q’
‘--quiet’
Turn off Wget’s output.

1-2. -O - 傳送到 標準輸出
1-2-1. https://www.gnu.org/software/wget/manua ... ad-Options
‘-O file’
If ‘-’ is used as file, documents will be printed to standard output, disabling link conversion.

1-3. 你猜 最後 哪個生效 ?
我测试了一下,有没有-q参数都一样。
我就不明白怎么会生成一个空的log文件,下面是wget输出到屏幕的提示:

代码: 全选

正在把输出重定向至 “wget-log”。

Re: wget 用了-q参数,怎么还会生成wget-log文件?

发表于 : 2018-05-07 17:48
astolia
haime 写了:下面是wget输出到屏幕的提示:

代码: 全选

正在把输出重定向至 “wget-log”。
除了这个就没有其他的了?
wget-log是指定了后台运行的参数才会生成,命令行中是-b或--background,但也可以在配置文件中设置。你检查一下 /etc/wgetrc 或 ~/.wgetrc里面是不是设置了background=on

相关的bug报告: https://savannah.gnu.org/bugs/?53020 ,检查一下你的wget版本