2017-11-21 14 views
0

나는 내가 가진어떻게 psql 명령을 제대로 볼 수 있습니까?

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

했다

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

테스트 내 데이터베이스 씨앗

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;' 

질문

어떻게에 대해 갈 것이라고이 더 디버그있어?


현재이 제안이 있습니다.

이 힌트/제안/도움은 매우 감사하겠습니다!

+0

명 다른 사람들이 그것을 개선하기 위해 OP에 대한 코멘트에서 아무 말없이 게시 downvote 때 나는 싫어. – ihue

+0

'시계'란 무엇입니까? – Barmar

+0

'watch'는 1 초마다 같은 명령을 다시 실행합니다. – ihue

답변

2

은 단일 인용 인수로 명령을 제공합니다 :

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