You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Quote integer variables for consistency and safety
This adds quotes around all integer variable usages to follow defensive
programming best practices:
- Quote variable assignments: ret="$?"
- Quote in numerical comparisons: [ "$ret" -eq 0 ]
- Quote in array indexing: ${MESSAGES["$ret"]}
- Quote in exit statements: exit "$ret"
While unquoted variables work in numeric contexts, quoting ensures:
1. Consistent coding style across the codebase
2. Protection against unexpected word splitting
3. Better shellcheck compliance
4. Clearer intent that these are variable expansions
0 commit comments