- Replace bash-specific &> with >/dev/null 2>&1 - Replace bash-specific == with POSIX-compliant = in [ ] tests - Script now works with both sh and bash - Fixes "unexpected operator" errors when run with sh Issue: User ran script with 'sh' instead of 'bash', causing errors Root cause: Bash-specific syntax (== and &>) not compatible with POSIX sh Solution: Use POSIX-compliant alternatives that work in both shells
20 KiB
20 KiB