【问题标题】:BusyBox - syntax error: unexpected redirectionBusyBox - 语法错误:意外重定向
【发布时间】:2012-07-18 17:52:32
【问题描述】:

我正在使用 OpenWRT(使用 BusyBox)。

当我运行这个脚本时:

 while read oldIP ; do
    iptables -t nat -D PREROUTING --dst $oldIP -p tcp --dport 443 -j DNAT --to 192.168.2.1:443
 done < <(comm -23 <(sort /tmp/currentIPs) <(sort /tmp/newIPs))

我收到此错误:

 syntax error: unexpected redirection 

我认为它不喜欢 "

【问题讨论】:

    标签: busybox openwrt ash


    【解决方案1】:

    sort /tmp/currentIPs > /tmp/currentIPs.sorted
    sort /tmp/newIPs > /tmp/newIPs.sorted
    comm -23 /tmp/currentIPs.sorted /tmp/newIPs.sorted | while read oldIP ; do
        iptables -t nat -D PREROUTING --dst $oldIP -p tcp --dport 443 -j DNAT --to 192.168.2.1:443
    done
    rm /tmp/currentIPs.sorted /tmp/newIPs.sorted
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-09
      • 2019-12-22
      • 1970-01-01
      • 1970-01-01
      • 2022-01-18
      • 2015-12-22
      • 2015-09-09
      • 2016-04-11
      相关资源
      最近更新 更多