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

上网、浏览、聊天、下载等
回复
haime
帖子: 294
注册时间: 2009-12-31 20:21
系统: Ubuntu、Windows 11
联系:

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

#1

帖子 haime » 2018-04-30 15:06

命令如下:

代码: 全选

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

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

#2

帖子 poloshiao » 2018-04-30 19:35

-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.
haime
帖子: 294
注册时间: 2009-12-31 20:21
系统: Ubuntu、Windows 11
联系:

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

#3

帖子 haime » 2018-05-01 9:06

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文件怎么回事?
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

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

#4

帖子 poloshiao » 2018-05-01 12:35

那个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. 你猜 最後 哪個生效 ?
haime
帖子: 294
注册时间: 2009-12-31 20:21
系统: Ubuntu、Windows 11
联系:

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

#5

帖子 haime » 2018-05-06 10:37

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”。
头像
astolia
论坛版主
帖子: 6396
注册时间: 2008-09-18 13:11

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

#6

帖子 astolia » 2018-05-07 17:48

haime 写了:下面是wget输出到屏幕的提示:

代码: 全选

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

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