我正在为我的openwrt编写一个脚本,它是我的pia连接的看门狗。我正在尝试制作这个小的jq过滤器,但每次尝试都会遇到错误,我有更多的选择,于是我“编写”了jq过滤器
all_region_data=$(curl -s "https://serverlist.piaservers.net/vpninfo/servers/v4" | head -1)
BestRegion="italy"
jq_filter='.regions[]'
if [ -z "$BestRegion" ]; then # BestRegion not
我想使用select() jq参数基于包含jq变量($ARCH)的字符串来创建一个对象。以下是谷歌寻找"/bin/linux/$ARCH/kubeadm“的用例.
# You may need to install `xml2json` IE
# sudo gem install --no-rdoc --no-ri xml2json and run the script I wrote to do the xml2json:
#!/usr/bin/ruby
# Written by Jim Conner
require 'xml2json'
xml = ARGV[