Fix show-status.sh filter variable and uninitialized pids array #5

Open
opened 2026-02-22 03:31:23 +00:00 by claude · 0 comments
Collaborator

Problem

Two bugs in show-status.sh:

1. Wrong filter variable (line 62)

The node name filter checks $1 instead of $part:

if [[ " ${params[@]} " =~ " $1 " ]];

Should be checking $part (the current compose file being iterated). This breaks node filtering by name.

2. Uninitialized pids array (line 71)

pids+=($!)  # Used without prior declaration

Should have declare -a pids=() before use to avoid undefined behavior.

Fix

  1. Change $1 to $part in the filter check
  2. Add declare -a pids=() near script start

Found during codebase audit

## Problem Two bugs in `show-status.sh`: ### 1. Wrong filter variable (line 62) The node name filter checks `$1` instead of `$part`: ```bash if [[ " ${params[@]} " =~ " $1 " ]]; ``` Should be checking `$part` (the current compose file being iterated). This breaks node filtering by name. ### 2. Uninitialized pids array (line 71) ```bash pids+=($!) # Used without prior declaration ``` Should have `declare -a pids=()` before use to avoid undefined behavior. ## Fix 1. Change `$1` to `$part` in the filter check 2. Add `declare -a pids=()` near script start --- *Found during codebase audit*
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: StakeSquid/ethereum-rpc-docker#5