Strip comments before checks

Strip comments before running checks.  I noticed this because devstack
uses '``foo``' to describe parameters in some places, and it's
triggering the $( check.

We strip after ' #' as the simplest form matching the bash rules as
mentioned in the comments.

Change-Id: Ib402cc47a3eab63d6220874b4c8e3d4b89c8ce61