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

linux.d/debian: use correct string match syntax #5103

Merged

Conversation

dankamongmen
Copy link
Contributor

The test(1) command (also known as [(1)) does not use the == syntax for testing equality, which is a feature of bash's [[ builtin. String equality is tested with '=', and numeric equality with -eq. This eliminates a series of warnings when running BuildLinux.sh on Debian-derived systems:

[schwarzgerat](0) $ ./BuildLinux.sh -u
./linux.d/debian: line 39: [: ==: unary operator expected
./linux.d/debian: line 39: [: ==: unary operator expected
./linux.d/debian: line 42: [: ==: unary operator expected

The test(1) command (also known as '[') does not use
the '==' syntax for testing equality, which is a
feature of bash's '[[' builtin. String equality
is tested with '=', and numeric equality with '-eq'.
This eliminates a series of warnings when running
BuildLinux.sh on Debian-derived systems:

[schwarzgerat](0) $ ./BuildLinux.sh -u
./linux.d/debian: line 39: [: ==: unary operator expected
./linux.d/debian: line 39: [: ==: unary operator expected
./linux.d/debian: line 42: [: ==: unary operator expected
@MackBambu MackBambu self-assigned this Oct 30, 2024
@MackBambu
Copy link
Contributor

Thank you for the suggestion. I need to conduct some tests.

Copy link
Contributor

@MackBambu MackBambu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lanewei120 "=" has better compatibility and can be merged.

@lanewei120 lanewei120 merged commit 733531b into bambulab:master Oct 31, 2024
2 checks passed
@dankamongmen dankamongmen deleted the dankamongmen/fix-debian-linux.d branch October 31, 2024 07:29
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

Successfully merging this pull request may close these issues.

3 participants