fix: make startup script sh compatible#15178
Merged
KomachiSion merged 1 commit intoMay 19, 2026
Merged
Conversation
|
Thanks for your this PR. 🙏 感谢您提交的PR。 🙏 |
Collaborator
|
Contributor
Author
|
这个 PR 的思路是把 startup.sh 中已知的 bash-only 语法改成 POSIX-compatible 写法,例如 [[ ... ]]、&>、read -p 等,因此理论上 bash 仍然可以使用,Ubuntu/Debian 下通过 sh/dash 执行时也应该可以避免 #15171 中提到的解析问题。
不过我目前只做了静态检查,确认 startup.sh 中不再包含这些 bash-only 写法,并检查了 diff 格式;还没有在 Linux/Unix/Ubuntu 等多个系统上实际运行验证。
相比 #15177 通过 sh 调用时重新切换到 bash 执行,这个 PR 是直接让 startup.sh 本身尽量兼容 sh/dash。如果维护者更倾向采用 POSIX-compatible 的方式,那么 #15177 可能就不再需要。
原始邮件
发件人:杨翊 SionYang ***@***.***>
发件时间:2026年5月19日 17:54
收件人:alibaba/nacos ***@***.***>
抄送:yijie zhao ***@***.***>, Author ***@***.***>
主题:Re: [alibaba/nacos] fix: make startup script sh compatible (PR #15178)
KomachiSion left a comment (alibaba/nacos#15178)
这样修改完,是不是bash和sh都可以使用了, 在多个系统下(linux,unix,ubuntu等)
#15177 这个PR是不是可以回滚了
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
KomachiSion
approved these changes
May 19, 2026
Collaborator
|
@jay666mnj 可以再帮忙提交一个PR, 先移除 #15177 的内容 |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
Fix startup.sh compatibility when users run it with
sh bin/startup.shon Ubuntu/Debian, where/bin/shis usually dash.Brief changelog
[[ ... ]]conditionals with POSIX-compatible[ ... ]&>redirection with> /dev/null 2>&1read -pwithprintf+readVerifying this change
rg -n "\[\[|\]\]|&>|read -p|==" distribution\bin\startup.shgit diff --cached --checkFixes #15171