Correct way to use a function with this “write to error log” command? Bash newbie so kindly bear with me!