trim trailing space from commands