Use single quotes around PG command to avoid problems with $$ and the shell.