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 bash script output in verify-geth-endpoint.sh #710

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

Conversation

VolodymyrBg
Copy link

Description

This pull request fixes a potential issue in the verify-geth-endpoint.sh script by adding double quotes around the arithmetic expansion when outputting the block number. This change follows bash scripting best practices and prevents potential issues when handling special characters or spaces in variable values.
The specific change is in the get_current_block() function, where:
echo $((16#$trimmed_hex))
was changed to:
echo "$((16#$trimmed_hex))"

Tests

The script functionality remains unchanged, but is now more robust. The script was manually tested to ensure it continues to work as expected with the added quotes.

Additional context

This is a minor fix that follows shell scripting best practices. While the specific issue might not manifest in this particular case (as arithmetic expansions typically don't contain spaces), it's good practice to quote variable expansions in bash to prevent word splitting and globbing.

Metadata

Fixes #N/A (No specific issue was referenced for this change)

@VolodymyrBg VolodymyrBg requested a review from a team as a code owner March 4, 2025 19:17
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