Use bourne-shell string matching

Previous attempt was bash-specific