gpt4 book ai didi

linux - 如何正确观看 psql 命令?

转载 作者:太空狗 更新时间:2023-10-29 11:49:19 24 4
gpt4 key购买 nike

种子

我为我的数据库播种

curl -s http://site/api/seed/user/1000

测试

我做到了

psql --username=nm -d portal -h 192.168.1.27 -c "SELECT count(*) from users;"

我得到了

 count                                                                                                                                                                                 
-------
1000
(1 row)

观看

watch psql --username=nm -d portal -h 192.168.1.27 -c "SELECT count(*) from users;"

我得到了

Every 2.0s: psql --username=nm -d portal -h 192.168.1.27 -...  bh-macbook-pro-15-512gb.local: Tue Nov 21 15:19:08 2017

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `psql --username=nm -d portal -h 192.168.1.27 -c SELECT count(*) from users;'

我该如何修复这个错误?

最佳答案

将命令作为单个带引号的参数提供:

watch 'psql --username=nm -d portal -h 192.168.1.27 -c "SELECT count(*) from users;"'

关于linux - 如何正确观看 psql 命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47422018/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com