gpt4 book ai didi

linux - 在 Bash 输出中获取特定文本

转载 作者:太空狗 更新时间:2023-10-29 11:25:01 26 4
gpt4 key购买 nike

我只想从这个输出中获取 ip,但我不知道怎么做。是否可以将输出限制为我想要的。

VPN Connection Setting Name                          |kap1
Destination VPN Server Host Name |159.89.199.192
Destination VPN Server Port Number |5252
Destination VPN Server Virtual Hub Name |kap
Proxy Server Type |Direct TCP/IP

另一个问题。 ip有端口。我只想要ip。对不起另一个问题。感谢大家的帮助。

VPN Connection Setting Name |kap1
Status |Connected
VPN Server Hostname |159.89.199.192:5252 (Direct TCP/IP Connection)

最佳答案

考虑到您共享的数据保存在一个文件中。文件名:文件.txt

$grep 'VPN Server Host Name' file.txt | awk -F '|' '{print $2}'
159.89.199.192

关于linux - 在 Bash 输出中获取特定文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50577227/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com