Shell Notes

References:

Handling Empty Variables

param Set and Not Null Set But Null Unset
${param:-word} substitute param substitute word substitute word
${param-word} substitute param substitute null substitute word
${param:=word} substitute param assign word assign word
${param=word} substitute param substitute null assign word
${param:?word} substitute param error, exit error, exit
${param?word} substitute param substitute null error, exit
${param:+word} substitute word substitute null substitute null
${param+word} substitute word substitute word substitute null

Adding Timestamps

Use ts command. ts -i for incremental time stamps. ts -s for time since start.