X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id A81DED1DADA for ; Tue, 13 Jan 2004 19:42:56 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 22265-08 for ; Tue, 13 Jan 2004 15:42:26 -0400 (AST) Received: from ndl1mr1-a-fixed.sancharnet.in (ndl1mr1-a-fixed.sancharnet.in [61.0.0.45]) by svr1.postgresql.org (Postfix) with ESMTP id 97B80D1DAE5 for ; Tue, 13 Jan 2004 15:42:24 -0400 (AST) Received: from conversion-daemon.ndl1mr1-a-fixed.sancharnet.in by ndl1mr1-a-fixed.sancharnet.in (iPlanet Messaging Server 5.2 HotFix 1.17 (built Jun 23 2003)) id <0HRG00G01189YP@ndl1mr1-a-fixed.sancharnet.in> for pgsql-admin@postgresql.org; Wed, 14 Jan 2004 01:11:32 +0530 (IST) Received: from sancharnet.in ([61.0.95.101]) by ndl1mr1-a-fixed.sancharnet.in (iPlanet Messaging Server 5.2 HotFix 1.17 (built Jun 23 2003)) with ESMTPA id <0HRG00JFE1CVS3@ndl1mr1-a-fixed.sancharnet.in> for pgsql-admin@postgresql.org; Wed, 14 Jan 2004 01:11:31 +0530 (IST) Date: Wed, 14 Jan 2004 01:17:41 +0530 From: Sai Hertz And Control Systems Subject: psql Automatic login In Bash Script To: pgsql-admin@postgresql.org Reply-To: aspire420@hotpop.com Message-id: <40044B5D.9040909@sancharnet.in> Organization: Sai Hertz And Control Systems MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/107 X-Sequence-Number: 11970 Dear all , I know this is a wrong list to for this post Anyways We use bash script for database maintainace and implimenting new schema in the production database the script goes as #!/bin/sh until [ "$uname" ] do read -s uname done until [ "$pass" ] do read -s pass done psql -U $uname mydatabase -f ./my_functions.sql psql -U $uname mydatabase -f ./my_tables.sql psql -U $uname mydatabase -f ./my_views.sql The problem is psql has no option such that I can pass on the variable $pass for password and as you can see I have to type in password three times (in real case 10 times) What I need is since password be stored in the bash variable for once I may pass on the variable with password to psql pg_dump pg_restore and my database migration would go smothly Also would not like to set ~/.pgpass Would be greateful to you all for any kinda help . Regards, Vishal Kashyap