You would only have to enter the password once if you changed your script like this.<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="color: rgb(170, 170, 170); font-family: 'Lucida Grande'; "><div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; ">
<b>#!/bin/bash</b></div><div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; "><b><br></b></div><div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; ">
<b>( </b></div><div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; "><b>for dir in BG CD CONCITY COUNTY COUSUB LINEARWATER PRIMARYROADS PRISECROADS RAILS ROADS STATE SUBMCD TABBLOCK</b></div>
<div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; "><b>do</b></div><div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; ">
<b> ldir="$(echo ${dir} | tr 'A-Z' 'a-z')" >> download.log</b></div><div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; ">
<b>shp2pgsql -s 4326 -p ${dir}/tl_2010_01_${ldir}10 public.${ldir}</b></div><div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; "><b><br></b></div>
<div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; "><b>done ) </b><b> | psql -h localhost -d geotest -U uname -W >> load.log </b></div>
<div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; "><b><br></b></div><div style="text-align: left; padding-top: 0px; padding-right: 5px; padding-bottom: 2px; padding-left: 5px; word-wrap: break-word; ">
<b><br></b></div></span><meta http-equiv="content-type" content="text/html; charset=utf-8">C.</div><div><br></div><div><br><div class="gmail_quote">On Sat, May 7, 2011 at 4:12 PM, Dheeraj Chand <span dir="ltr"><<a href="mailto:dheeraj@dheerajchand.com">dheeraj@dheerajchand.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div style="padding-top:1px;padding-right:5px;padding-bottom:1px;padding-left:5px;margin-bottom:3px;font-family:'Lucida Grande'">
<br><span>:</span><span style="word-wrap:break-word">I have the world's dumbest question today. I am running a bash script that goes through several directories (and each of their several subdirectories) of shapefiles to run shp2pgsql and put them into the correct PSQL schema and table. I'd like to be able to set it and forget it, so to speak, but each time, the shell is prompting me for the user's password. Is there a way to hardcode the password in?</span></div>
<div style="color:rgb(170, 170, 170);text-align:center;padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word;font-family:'Lucida Grande'"><span style="display:block;margin-top:0px;margin-left:5px;float:right;font-size:9px;color:rgb(136, 136, 136);word-wrap:normal">[</span><span style="display:block;margin-top:0px;margin-left:5px;float:right;font-size:9px;color:rgb(136, 136, 136);word-wrap:normal">4:06pm</span><span style="display:block;margin-top:0px;margin-left:5px;float:right;font-size:9px;color:rgb(136, 136, 136);word-wrap:normal">] </span><b><br>
</b></div><div style="text-align:left;color:rgb(170, 170, 170);padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word;font-family:'Lucida Grande'"><div style="text-align:left;padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word">
<b>#!/bin/bash</b></div><div style="text-align:left;padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word"><b>for dir in BG CD CONCITY COUNTY COUSUB LINEARWATER PRIMARYROADS PRISECROADS RAILS ROADS STATE SUBMCD TABBLOCK</b></div>
<div style="text-align:left;padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word"><b>do</b></div><div style="text-align:left;padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word">
<b> ldir="$(echo ${dir} | tr 'A-Z' 'a-z')" >> download.log</b></div><div style="text-align:left;padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word">
<b>shp2pgsql -s 4326 -p ${dir}/tl_2010_01_${ldir}10 public.${ldir} | psql -h localhost -d geotest -U uname -W pass >> load.log</b></div><div style="text-align:left;padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word">
<b><br></b></div><div style="text-align:left;padding-top:0px;padding-right:5px;padding-bottom:2px;padding-left:5px;word-wrap:break-word"><b>done</b></div></div><div style="padding-top:1px;padding-right:5px;padding-bottom:1px;padding-left:5px;margin-bottom:3px;font-family:'Lucida Grande'">
<span style="display:block;margin-top:0px;margin-left:5px;float:right;font-size:9px;color:rgb(136, 136, 136);word-wrap:normal">[</span><span style="display:block;margin-top:0px;margin-left:5px;float:right;font-size:9px;color:rgb(136, 136, 136);word-wrap:normal">4:07pm</span><span style="display:block;margin-top:0px;margin-left:5px;float:right;font-size:9px;color:rgb(136, 136, 136);word-wrap:normal">]</span><span><br>
Here is the script: <a href="http://pastebin.com/prWLzEtk" target="_blank">http://pastebin.com/prWLzEtk</a>:</span></div></div><br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Carl Anderson, GISP<br> <br><a href="mailto:canderson@spatialfocus.com" target="_blank">canderson@spatialfocus.com</a><br><a href="mailto:carl.anderson@vadose.org" target="_blank">carl.anderson@vadose.org</a><br>
<br>
</div>