Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Use = for [ ... ] tests instead of bash's == #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

meineerde
Copy link

For Bash, the builtin command test resp. [ accepts both == as well as = as an operator. POSIX however only specifies =. Thus, if the scripts are used with a /bin/sh which is not Bash, e.g. dash on Debian derivates, the test fail with:

[: 1: unexpected operator

This commit ensures that only the POSIX-conformiing operator = is used. For Bash, it doesn't make any difference, for other shells, it ensures that the scripts still work.

This pull request is an alternative solution to #36 and should fix #17 and (at least part of) #32.

For Bash, the builtin command `test` resp. `[` accepts both `==` as well
as `=` as an operator. POSIX however only specifies `=`. Thus, if the
scripts are used with a `/bin/sh` which is not Bash, e.g. dash on Debian
derivates, the test fail with:

[: 1: unexpected operator

This commit ensures that only the POSIX-conformiing operator `=` is
used. For Bash, it doesn't make any difference, for other shells, it
ensures that the scripts still work.
Copy link
Collaborator

@cezmunsta cezmunsta left a comment

Choose a reason for hiding this comment

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

Close in favour of #36

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't specify database with pmp-check-mysql-replication-delay
2 participants