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)
Bugs Found
1. Sleep inside inner loop (HIGH)
procstat-collect line 44:
sleep $intervalis inside thefor file in $good_filesloop. With 7 files and a 3s interval, each file is sampled every 21s instead of every 3s. The sleep should be after the innerdone.2. Missing exit 1 after error (HIGH)
procstat-start line 68: Missing
exit 1after 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 isprocstat-pid.txt(singular). The cleanup never removes the intended file.4. Typos (LOW)
procstst-pid.txt(should beprocstat-pid.txt)Invalid optioni(should beInvalid option)must a be a positive interger(should bemust be a positive integer)