<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span><div><span>Hi, the problem is here:</span><span style="color: rgb(69, 69, 69); font-family: Helvetica, Arial, sans-serif; font-size: 12px; font-weight: bold;">cat infile</span></div><div style="color: rgb(69, 69, 69); font-size: 12px; font-family: Helvetica, Arial, sans-serif; background-color: transparent;"><span>You need to write: </span><span style="font-weight: bold;">cat $infile</span></div></span></div><div><br></div> <div style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">Απο:</span></b> Kirk Wythers <kirk.wythers@gmail.com><br> <b><span style="font-weight:
bold;">Προς:</span></b> grass-user grass-user <grass-user@lists.osgeo.org> <br> <b><span style="font-weight: bold;">Στάλθηκε:</span></b> 9:23 μ.μ. Παρασκευή, 4 Ιανουαρίου 2013<br> <b><span style="font-weight: bold;">Θέμα:</span></b> [GRASS-user] db loading error<br> </font> </div> <br>Not exactly a grass question, but I figured you all might see what I'm doing wrong. I am trying load a postgis db that is connected to grass. <br><br>in order to do so, I'd like to automate the 100 or so files that need to be read into the db with a \copy process from a bash script. See below:<br><br>#!/bin/sh<br>for infile in /Volumes/disk7/b4warmed3/export/60min2/*.csv<br>do<br> cat infile | psql -h localhost dbname -c "\copy table1 FROM stdin with delimiter as ',' NULL AS 'NA' CSV HEADER"<br>done<br><br>I'm getting an error about the name of the file I'm building to then copy from into the db. <br><br>Does this approach
require that I create the file "infile" first? And if so, in what directory? Or does someone see some ridiculously stupid mistake I'm making? <br><br>Here's the error:<br><br>[kirkw@truffula]bin$ ./b4warmed_loader <br>cat: infile: No such file or directory<br>Password: <br>cat: infile: No such file or directory<br>Password: <br>cat: infile: No such file or directory<br>Password: <br>cat: infile: No such file or directory<br>Password: <br><br><br>_______________________________________________<br>grass-user mailing list<br><a ymailto="mailto:grass-user@lists.osgeo.org" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br><br><br> </div> </div> </div></body></html>