Skip to content
Advertisement

bash list postgresql databases over ssh connection

I am doing some work on a remote Postgresql database.

When I log into the server this command works on bash: $ psql -c “l”

Remote login over ssh is possible using:

JavaScript

But why doesn’t it work from this command?

JavaScript

This is working, also “psql -l” but I don’t understand why I have to use backslash 3 times here?

JavaScript

Advertisement

Answer

Use several levels of quoting:

JavaScript

The double backslash is not strictly necessary since l is no recognized escape sequence.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement