Don’t quote me on this
Top tip of the day: don’t quote backticks when setting variables. Their content is not split, though everyone seems to do it, and it’s not portable. You also don’t need to quote anything that is used at the head of a case statement. Keep quoting variables everwhere else though! (Surely you’re not like a certain unnamed company where, despite my gentle urgings against bashisms and shell malpractice, we still can’t do a build from a checkout into a path with spaces?)
Finally, I excised a really nasty bit of code from a script we actually send to customers which was lifted from an old version of autoconf. It attempts to use echo to perform a simple printf %s ... by testing for all the platform-specific switches like -n and \c. Don’t do this! The last shipping OSes without printf were SysVR3 (until 1988) and SunOS 4 (until 1994). If you love your really old shells just too much, at least do what autoconf 2.50 does and use printf first if it’s available (testing with an eval, of course, because, as usual, it might not be on your PATH on Solaris…).