Received: from cerberus1.kcp.com (kcpgw.kcp.com [198.62.69.65]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2QI4cw36474 for ; Mon, 26 Mar 2001 13:04:38 -0500 (EST) (envelope-from hook@kcp.com) Message-Id: <200103261804.f2QI4cw36474@mail.postgresql.org> Received: by kcpgw.kcp.com id MAA22650 (InterLock SMTP Gateway 5.0 for pgsql-sql@postgresql.org); Mon, 26 Mar 2001 12:04:37 -0600 (CST) Received: by kcpgw.kcp.com (Internal Mail Agent-2); Mon, 26 Mar 2001 12:04:37 -0600 (CST) Received: by kcpgw.kcp.com (Internal Mail Agent-1); Mon, 26 Mar 2001 12:04:37 -0600 (CST) Received: by kcpgw.kcp.com (Internal Mail Agent-0); Mon, 26 Mar 2001 12:04:37 -0600 (CST) Date: Mon, 26 Mar 2001 12:04:28 -0600 From: "A. Van Hook" X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12-20 i586) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: paging Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Archive-Number: 200103/527 X-Sequence-Number: 2197 I have a simple script to automate sql statements: q " select * from tablename" where q is an alias to echo "$@ ; " | psql imdb Turning on security breaks this script since is need s password. the new one works a before: q "select *..." passwd where q is now an expect script: #!/usr/bin/expect set query [lindex $argv 0] set query [lindex $argv 1] spawn psql imdb -U hook -n expect "Password: "; send "$passwd\n "; expect "imdb=# "; send "$query;\r"; expect "imdb=# "; send "\q;\r"; The problem is that long query returns invoke the paging option so you can scroll a page a time. Paging doesn't work properly within the script and even if it did , I would have to disable it in order to redirect the output to a file or a pipe. I can't find any info in the docs. Can some one point me in the right direction.... thanks