u/fjammes/dm-1446

Reviewing DM-1446
Thanks Andy for these usefull remarks.
I take everything in account, and I think most of them should be checked also for my whole code.
I tried to do my best in order to manage whitespace in this ticket shell scripts, but I'm not a shell expert so some problems may still persist.

Thanks.

Fabrice