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

fix: Fix comparison operator for numeric values #8953

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

Conversation

famouswizard
Copy link
Contributor

PR Description

I noticed that the script was using == to compare two numeric values in the conditional statement, which is typically used for string comparisons in bash. For numeric comparisons, it's more appropriate to use -eq. I've updated the conditional to use -eq instead of ==, ensuring that the comparison works as expected for numbers.

Here’s the change:

  • Replaced == with -eq in the comparison:
    if [ "$file_dircount" -eq "$testfile_dircount" ]; then

This update ensures that the comparison is treated correctly as a numerical one, preventing potential issues in certain scenarios.

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

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.

1 participant