@Dr_Emann I do already use shellcheck and sufficiently peppered in the right quotes but still wasn't able to convince the shell to behave properly.