POSIX: Fix quoting for expansion and switch from echo to printf