Fix on Solaris by accounting for /bin/sh there.

Solaris' /bin/sh does not grok $(...), so use `...` instead.

Note that all recent versions of Solaris have included /bin/bash, but
I'm not sure the impact of using #!/bin/bash instead of #!/bin/sh on
some of our other platforms.
For consistency with other shell scripts here, use #!/bin/sh.

This (alone) used #!/bin/bash, but does not seem to depend on it.