shell 如何只能输出位置线在一个 curl |grep pipeline?[副本]

nkkqxpd9  于 2023-08-07  发布在  Shell
关注(0)|答案(1)|浏览(85)

此问题在此处已有答案

How can I quiet all the extra text when using curl within a shell script?(1个答案)
How can I keep curl output out of mail from my cronjob?(2个答案)
Reduce output of curl command(3个答案)
How do I get cURL to not show the progress bar?(7个答案)
26天前关闭。
在我的终端:

curl wttr.in/hak | grep Location
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8827  100  8827    0     0  25438      0 --:--:-- --:--:-- --:--:-- 25438
Location: Республика Хакасия, Сибирский федеральный округ, Россия [53.4399379,90.0664303]

字符串
如何获得唯一的位置线?

Location: Республика Хакасия, Сибирский федеральный округ, Россия [53.4399379,90.0664303]

a0zr77ik

a0zr77ik1#

使用-s标志:

$ curl -s wttr.in/hak | grep Location
Location: Республика Хакасия, Сибирский федеральный округ, Россия [53.4399379,90.0664303]

字符串

相关问题