In addition to shell best practices:
- Prefer
${var,,}and${var^^}overtrfor changing case. - Prefer
${var//from/to}oversedfor simple string replacements. - Prefer
[[overtestor[. - Prefer process substitution over a pipe in
while readloops. - Use
((orlet, not$((when you don't need the result