답변:
문서화 한대로 --command옵션을 통해 메타 명령을 실행할 수 있습니다 .
sudo -u postgres psql --command '\password postgres'
작은 따옴표는 쉘이 백 슬래시를 이스케이프 문자로 취급하지 않도록합니다.
sudo -u postgres psql --command "\password"있습니다. 궁금해, 왜 내 질문이 downvoted.
"\\..."합니다.
The backslash retains its special meaning only when followed by one of the following characters: ‘$’, ‘`’, ‘"’, ‘\’, or newline.나는 그 이유를 생각 "\password"가공 한 고급.
man.man psql앞으로 시도하십시오 .