Closed edonyzpc closed 1 year ago
在 BSD/MacOS 中执行 README 中的 sed 命令行时 sed -i "/# GitHub520 Host Start/Q" /etc/hosts 有如下报错:
sed -i "/# GitHub520 Host Start/Q" /etc/hosts
[edony@MacBook-Pro.local ~ :57]$ >> sed -i "/# GitHub520 Host Start/Q" /etc/hosts sed: 1: "/etc/hosts": extra characters at the end of h command
错误原因应该是: BSD/MacOS 的 sed 和 GNU sed 命令行参数不一样
README 2.3 增加 macOS/BSD sed 命令支持:
# for GNU sed (Ubuntu/CentOS/Fedora) sed -i "/# GitHub520 Host Start/Q" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts # for BSD/macOS sed sed -i "" "/# GitHub520 Host Start/,/# Github520 Host End/d" /etc/hosts && curl https://raw.hellogithub.com/hosts >> /etc/hosts
@edonyzpc 感谢贡献,已更新。
在 BSD/MacOS 中执行 README 中的 sed 命令行时
sed -i "/# GitHub520 Host Start/Q" /etc/hosts
有如下报错:错误原因应该是: BSD/MacOS 的 sed 和 GNU sed 命令行参数不一样
README 2.3 增加 macOS/BSD sed 命令支持: