Skip to content

运行脚本时报错——grep: warning: stray \ before / #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kingofotaku opened this issue Feb 12, 2023 · 10 comments
Closed

运行脚本时报错——grep: warning: stray \ before / #10

kingofotaku opened this issue Feb 12, 2023 · 10 comments

Comments

@kingofotaku
Copy link

完整日志:
2023-02-12 16:18:12 [1038064]:
2023-02-12 16:18:12 [1038064]: LZ v3.8.8 script commands start......
2023-02-12 16:18:12 [1038064]: By LZ (larsonzhang@gmail.com)
2023-02-12 16:18:12 [1038064]: ----------------------------------------
2023-02-12 16:18:12 [1038064]: Location: /jffs/scripts/lz
2023-02-12 16:18:12 [1038064]: ----------------------------------------
2023-02-12 16:18:13 [1038064]: Initialization script configuration parameters......
grep: warning: stray \ before -
grep: warning: stray \ before -
2023-02-12 16:18:16 [1038064]: Configuration parameters initialization is complete.
2023-02-12 16:18:16 [1038064]: Get the router device information......
2023-02-12 16:18:16 [1038064]: ----------------------------------------
2023-02-12 16:18:16 [1038064]: Route Model: RT-AX88U
2023-02-12 16:18:16 [1038064]: Hardware Type: aarch64
2023-02-12 16:18:16 [1038064]: Host Name: RT-AX88U-Maiki
2023-02-12 16:18:16 [1038064]: Kernel Name: Linux
2023-02-12 16:18:16 [1038064]: Kernel Release: 4.1.51
2023-02-12 16:18:16 [1038064]: Kernel Version: #2 SMP PREEMPT Fri Dec 9 21:44:04 CST 2022
2023-02-12 16:18:16 [1038064]: OS Name: ASUSWRT-Merlin-KoolShare
2023-02-12 16:18:16 [1038064]: Firmware Version: 3.0.0.4.388.1
2023-02-12 16:18:16 [1038064]: Firmware Build: Fri Dec 9 13:41:24 UTC 2022 sadog@c4950e2
2023-02-12 16:18:16 [1038064]: Bootloader (CFE): 1.0.1.0
2023-02-12 16:18:16 [1038064]: CPU temperature: 72.873 degrees C
2023-02-12 16:18:16 [1038064]: 2.4 GHz temperature: 45.5 degrees C
2023-02-12 16:18:16 [1038064]: 2.4 GHz Tx Power: 28.25 dBm / 668.34 mW (31.75 dBm / 1496 mW)
2023-02-12 16:18:16 [1038064]: 5 GHz temperature: 46 degrees C
2023-02-12 16:18:16 [1038064]: 5 GHz Tx Power: 28.25 dBm / 668.34 mW (31.75 dBm / 1496 mW)
2023-02-12 16:18:16 [1038064]: NVRAM usage: 83052 / 131072 bytes
2023-02-12 16:18:16 [1038064]: Route Status: Link
2023-02-12 16:18:16 [1038064]: Route Encap: Ethernet
2023-02-12 16:18:16 [1038064]: Route HWaddr: 04:D4:C4:4F:9D:38
2023-02-12 16:18:16 [1038064]: Route Local IP Addr: 192.168.1.1
2023-02-12 16:18:16 [1038064]: Route Local Bcast: 192.168.1.255
2023-02-12 16:18:16 [1038064]: Route Local Mask: 255.255.255.0
2023-02-12 16:18:16 [1038064]: Route Usage Mode: Dynamic Policy
2023-02-12 16:18:16 [1038064]: Route Policy Mode: Mode 3
grep: warning: stray \ before -
2023-02-12 16:18:16 [1038064]: Route Domain Policy: Enable
2023-02-12 16:18:16 [1038064]: Route Host Access Port: Primary WAN
2023-02-12 16:18:16 [1038064]: Route Cache: Enable
2023-02-12 16:18:16 [1038064]: Route Flush Cache: System
2023-02-12 16:18:16 [1038064]: ----------------------------------------
2023-02-12 16:18:16 [1038064]: Initializes the policy routing library......
2023-02-12 16:18:16 [1038064]: ----------------------------------------
2023-02-12 16:18:16 [1038064]: ip_rule_prio_24961 = 2
2023-02-12 16:18:17 [1038064]: ip_rule_prio_24997 = 1
2023-02-12 16:18:17 [1038064]: ip_rule_prio_24998 = 1
2023-02-12 16:18:17 [1038064]: ip_rule_prio_24999 = 1
2023-02-12 16:18:17 [1038064]: ----------------------------------------
2023-02-12 16:18:17 [1038064]: Policy routing library has been initialized.
2023-02-12 16:18:17 [1038064]: Successfully registered firewall-start interface.
2023-02-12 16:18:17 [1038064]: ----------------------------------------
2023-02-12 16:18:17 [1038064]: Update ISP Data: 6:25 Every 3 days
2023-02-12 16:18:17 [1038064]: ----------------------------------------
2023-02-12 16:18:17 [1038064]: The router has successfully joined into two WANs.
2023-02-12 16:18:17 [1038064]: Policy routing service is being started......
grep: warning: stray \ before /
grep: warning: stray \ before /
2023-02-12 16:18:51 [1038064]: ----------------------------------------
2023-02-12 16:18:51 [1038064]: Successfully registered openvpn-event interface.
2023-02-12 16:18:51 [1038064]: ----------------------------------------
2023-02-12 16:18:51 [1038064]: Primary WAN Local Area Network
2023-02-12 16:18:51 [1038064]: 115.208.50.129
2023-02-12 16:18:51 [1038064]: ----------------------------------------
2023-02-12 16:18:51 [1038064]: Secondary WAN Local Area Network
2023-02-12 16:18:51 [1038064]: 60.184.56.64
2023-02-12 16:18:51 [1038064]: ----------------------------------------
2023-02-12 16:18:51 [1038064]: FOREIGN Primary WAN
2023-02-12 16:18:51 [1038064]: CTCC Equal Division
2023-02-12 16:18:51 [1038064]: CUCC/CNC Redivision
2023-02-12 16:18:51 [1038064]: CMCC Equal Division
2023-02-12 16:18:51 [1038064]: CERNET Equal Division
2023-02-12 16:18:51 [1038064]: GWBN Redivision
2023-02-12 16:18:51 [1038064]: OTHER Equal Division
2023-02-12 16:18:51 [1038064]: HONGKONG Redivision
2023-02-12 16:18:51 [1038064]: MACAO Equal Division
2023-02-12 16:18:51 [1038064]: TAIWAN Redivision
2023-02-12 16:18:51 [1038064]: ----------------------------------------
2023-02-12 16:18:51 [1038064]: Using Netfilter Technology.
2023-02-12 16:18:51 [1038064]: ----------------------------------------
2023-02-12 16:18:52 [1038064]: The VPN client route daemon has been started.
2023-02-12 16:18:52 [1038064]: ----------------------------------------
2023-02-12 16:18:52 [1038064]: ip_rule_prio_24961 = 2
2023-02-12 16:18:52 [1038064]: ip_rule_prio_24997 = 1
2023-02-12 16:18:52 [1038064]: ip_rule_prio_24998 = 1
2023-02-12 16:18:52 [1038064]: ip_rule_prio_24999 = 1
2023-02-12 16:18:52 [1038064]: ----------------------------------------
2023-02-12 16:18:52 [1038064]: Policy routing service has been started successfully.
2023-02-12 16:18:52 [1038064]: ----------------------------------------
2023-02-12 16:18:52 [1038064]: LZ v3.8.8 script commands executed!
2023-02-12 16:18:52 [1038064]:
大佬有空看一下是哪里的问题 系统是388.1 ax88u

@larsonzh
Copy link
Owner

larsonzh commented Feb 12, 2023

谢谢反馈。

我gt-ax6000的梅林官方388.1固件里暂未见此grep命令警告(不一定是错误),可能与该版梅林固件改版中的某些内部设定有关,对脚本运行是否有影响,需进一步观察。

旧版脚本有此问题吗?

@kingofotaku
Copy link
Author

没试过 但我的确是在3.8.8上第一次看见这个错误 一开始我怀疑是我装了entware里的grep导致的 但我想删它又提示说grep是必要依赖删不掉

@kingofotaku
Copy link
Author

其实我只想知道这对脚本效果有无影响,如果确定没有的话报错就报错也没所谓

@kingofotaku
Copy link
Author

如果方便的话 大佬可以试试装entware里的grep试试会不会出现这个提示

@larsonzh
Copy link
Owner

larsonzh commented Feb 12, 2023

我之前使用官方梅林里的amtm命令在USB盘上安装了Entware,同时将脚本分别安装到U盘和jffs分区,然后分别运行,均未发现此警告信息。

grep是脚本中必须使用的命令,该情况确实与grep模块的版本有关。刚发现,Entware中的grep从3.7升级到3.8后出现此警告,似乎未影响脚本的正常运行。

从你脚本的启动信息里看出,两条线路均为电信,电信网段出口参数选择了均分,可能是dhcp方式连接的光猫,脚本似乎能够正常运行。

当然,是否有问题还需进一步分析和观察。

@kingofotaku
Copy link
Author

是的 但我是pppoe不是光猫拨号。dhcp只是为了管理光猫后台 这会影响脚本运行吗 会的话我可以关掉

@larsonzh
Copy link
Owner

larsonzh commented Feb 12, 2023

是的 但我是pppoe不是光猫拨号。dhcp只是为了管理光猫后台 这会影响脚本运行吗 会的话我可以关掉

是路由器拨号吗?这个在显示中为本地局域网,有些奇怪,未能显示线路出口的运营商标识,不知是否有代码的原因,虽对运行没影响,回头还是要再查一下。

前面的问题搞清楚了。grep包升级后,对搜索内容中的\转义符号提高了命令格式要求。虽然还能兼容和识别既有的使用方式,不影响正常运行,但会发出警告信息。脚本会在后续版本中提高对新版grep命令的兼容性,消除该警告信息。

@kingofotaku
Copy link
Author

kingofotaku commented Feb 12, 2023

是的 但我是pppoe不是光猫拨号。dhcp只是为了管理光猫后台 这会影响脚本运行吗 会的话我可以关掉

是路由器拨号吗?这个在显示中为本地局域网,有些奇怪,未能显示线路出口的运营商标识,不知是否有代码的原因,虽对运行没影响,回头还是要再查一下。

前面的问题搞清楚了。grep包升级后,对搜索内容中的\转义符号提高了使用格式要求,虽然还能兼容和识别既有的使用方式,不影响正常运行,目前仅会发出警告信息,但出于长远考虑,脚本会在后续版本中提高对新版grep命令的兼容性,消除该警告信息。

是路由器拨号,光猫开了DHCP,所以首页wan信息里的外部ip会有两个,一个是路由器wan口在光猫网域下的地址(192.168.5.x),一个就是广域网ip。也不知道光猫的ip会不会干扰分流。

@larsonzh
Copy link
Owner

如此应该能正常分流。

@larsonzh
Copy link
Owner

没试过 但我的确是在3.8.8上第一次看见这个错误 一开始我怀疑是我装了entware里的grep导致的 但我想删它又提示说grep是必要依赖删不掉

新版v3.8.9脚本解决了此问题,可以试试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants