如何在命令行中转义可能的连字符,如下所示:
$ for i in db1 db2 db1-db2; do su - postgres -c "psql -c \"alter database \"$i\" with connection limit = 0;\""; done
ALTER DATABASE
ALTER DATABASE ERROR: syntax error at or near "-" at character 19 LINE 1: alter database db1-db2 with connection limit = 0;
^