Skip to content

fix: sleep in inner per-file loop and missing exit on error #34

Description

@k-rister

Bugs Found

1. Sleep inside inner loop (HIGH)

procstat-collect line 44: sleep $interval is inside the for file in $good_files loop. With 7 files and a 3s interval, each file is sampled every 21s instead of every 3s. The sleep should be after the inner done.

2. Missing exit 1 after error (HIGH)

procstat-start line 68: Missing exit 1 after the error message about a missing binary — the script falls through and exits 0 (success), masking the failure.

3. Wrong filename in rm command (MEDIUM)

procstat-start line 57: rm -f procstat-pids.txt (plural) but the actual file created is procstat-pid.txt (singular). The cleanup never removes the intended file.

4. Typos (LOW)

  • procstat-stop line 19: procstst-pid.txt (should be procstat-pid.txt)
  • procstat-start line 39: Invalid optioni (should be Invalid option)
  • procstat-collect line 8: must a be a positive interger (should be must be a positive integer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions