Some bash versions don't support negative lengths

Fix to make the service string work on these versions of bash too

Change-Id: Ibb9868ea7bf44480be76a8ea9d7d9fbc278a8ef3
Merge "Some bash versions don't support negative lengths"