Skip to content
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

[Bug][Script] The bin/init-config.sh compatible with MacOS #6685

Closed
2 tasks done
featzhang opened this issue Nov 30, 2022 · 0 comments · Fixed by #6686
Closed
2 tasks done

[Bug][Script] The bin/init-config.sh compatible with MacOS #6685

featzhang opened this issue Nov 30, 2022 · 0 comments · Fixed by #6686
Assignees
Labels
type/bug Something is wrong
Milestone

Comments

@featzhang
Copy link
Member

Description

When executing the bin/init-config.sh script in the MacOS environment, the following error will occur:

$ bin/init-config.sh
Init agent configuration parameters
sed: 1: "agent.properties": command a expects \ followed by text
sed: 1: "agent.properties": command a expects \ followed by text
sed: 1: "agent.properties": command a expects \ followed by text
sed: 1: "agent.properties": command a expects \ followed by text
sed: 1: "agent.properties": command a expects \ followed by text
Init audit configuration parameters
sed: 1: "application.properties": command a expects \ followed by text
sed: 1: "application.properties": command a expects \ followed by text
sed: 1: "application.properties": command a expects \ followed by text
sed: 1: "audit-proxy-pulsar.conf": command a expects \ followed by text
sed: 1: "application.properties": command a expects \ followed by text
Init dataproxy configuration parameters
sed: 1: "common.properties": command c expects \ followed by text
sed: 1: "common.properties": command c expects \ followed by text
sed: 1: "dataproxy-pulsar.conf": extra characters at the end of d command
Init inlong manager configuration
sed: 1: "application.properties": command a expects \ followed by text
sed: 1: "application.properties": command a expects \ followed by text
sed: 1: "application-dev.properties": command a expects \ followed by text
sed: 1: "application-dev.properties": command a expects \ followed by text
sed: 1: "application-dev.properties": command a expects \ followed by text
Init inlong manager flink plugin configuration
sed: 1: "flink-sort-plugin.prope ...": invalid command code f
sed: 1: "flink-sort-plugin.prope ...": invalid command code f

Because the syntax of the sed command in the MacOS environment is different from that in the GNU environment, it is not compatible.

sed -i -e ... # does not work on OS X as it creates -e backups
sed -i'' -e ... # does not work on OS X 10.6 but works on 10.9+
sed -i '' -e ... # not working on GNU

Use case

Therefore, when the init-config.sh script executes the sed command, it is necessary to first determine the current OS type and perform respective adaptations. The sed command is used for substitution in MacOS,

sed -i ...

while GNU syntax can be used in Linux.

sed -i '' ...

Are you willing to submit PR?

  • Yes, I am willing to submit a PR!

Code of Conduct

@featzhang featzhang changed the title [Feature] The bin/init-config.sh compatible with MacOS [Feature][Script] The bin/init-config.sh compatible with MacOS Nov 30, 2022
@healchow healchow changed the title [Feature][Script] The bin/init-config.sh compatible with MacOS [Bug][Script] The bin/init-config.sh compatible with MacOS Nov 30, 2022
@healchow healchow added type/bug Something is wrong and removed type/feature labels Nov 30, 2022
@healchow healchow added this to the 1.5.0 milestone Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants