Tidy the do-it script to conform to bash8

Clean up the primary analysis runner script to conform to bash8 standards
for trailing whitespace and function definitions

Change-Id: Ib7bcbc97a19d8726e826e61b2f9228c1b1186b69
Merge "Tidy the do-it script to conform to bash8"