ashi009 / bestroutetb

Generating the most optimized route table for VPN users.
MIT License
879 stars 99 forks source link

使用-p custom时候,--rule-format里的\n不会转义 #25

Closed momaer closed 9 years ago

momaer commented 9 years ago

bestroutetb -f -p custom -o ./bestroutetb.txt --rule-format="iptables -t nat -A SHADOWSOCKS -d %prefix/%length -j RETURN\n" 最终生成的是一行: iptables -t nat -A SHADOWSOCKS -d 0.0.0.0/0 -j RETURN\niptables -t nat -A SHADOWSOCKS -d 0.0.0.0/7 -j RETURN\n ...... 不会pull request,作者你有时间改一下呗?谢谢啦!祝你好人一生平安。

momaer commented 9 years ago

hi, ashi009,我看了lib/formatter.js的代码,使用以下方法解决了: 在终端输入: bestroutetb -f -p custom -o ./bestroutetb.txt --rule-format='iptables -t nat -A SHADOWSOCKS -d %prefix/%length -j RETURN '

ashi009 commented 9 years ago

这是shell的问题,我在文档里对这个写了这个例子。用$'ABC\n'就好了~