这是一个示例 ip 代理检查器 shell 脚本:
#!/bin/sh
while read IP
do
CURL=$(curl -x http://$IP -L http://icanhazip.com)
echo "$CURL"
done < ip.txt
Run Code Online (Sandbox Code Playgroud)
但不是像这样的简单结果:
0.0.0.0
1.1.1.1
Run Code Online (Sandbox Code Playgroud)
我得到:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
0.0.0.0
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
1.1.1.1
Run Code Online (Sandbox Code Playgroud)
我怎样才能让多余的东西安静下来?
-s/--silent
静音模式。不要显示进度表或错误消息。使 Curl 静音。如果此选项使用两次,第二个将再次禁用静音。
CURL=$(curl -s -x http://$IP -L http://icanhazip.com)
Run Code Online (Sandbox Code Playgroud)