-
Notifications
You must be signed in to change notification settings - Fork 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
sed 命令在 macOS 执行报错 #3
Comments
mac sed 和 GNU sed 不同,这样改的话,Linux 就无法执行了,参考:https://github.com/sinkcup/laravel-demo/blob/6e643b862b8ff1f4b2718b4316f5efcf2920bf97/phpunit.sh#L14 判断要写好几行,最简单的办法就是:
|
@ZhangChaoWN gnu-sed 也不好,其他 mac 脚本运行时可能报错…… |
这里还有一种方法:https://stackoverflow.com/a/22247781,用perl: |
个人感觉 |
发现了一个好方案,对 mac 进行标准化:https://github.com/fabiomaia/linuxify |
原因:macOS 的 sed 与 linux 有差异,
-i
开关后面有一个必填参数 extension。解决方法:提供一个空的extension参数,如:
The text was updated successfully, but these errors were encountered: