Eliminate 'tr' in favor of inline bash.

Updates the lib/common-functions generate_hooks() function
to use bash instead of exec'ing tr.

Change-Id: Ie32d3ce5c7c43affd0031a568d57763e36209603
Merge "Eliminate 'tr' in favor of inline bash."