Hi, short intrusion in this current thread, without knowing exactly what it is related to : I only mean to suggest you to close the while loop...
This prompt ">" means the shell expects the end of your statement ; here you should type "done" to close the while instruction. Hope it helps, Regards. Vincent Le mercredi 11 août 2010 à 14:10 +0200, Hanlie Pretorius a écrit : > My apologies for my ignorance, but how do I get this to run in Linux? > Am using Ubuntu 10.04 and GRASS 6.4RC6. > > I entered the following into the GRASS text window and am testing it > with a list of two files (I removed the region settings because the > files all have the same region, which I have already set): > ----- > GRASS 6.4.0RC6 (world_wgs84):~ > cat lieb_files_test.txt > 3B42.000201.12.6.nc.lieb.txt > 3B42.000201.15.6.nc.lieb.txt > GRASS 6.4.0RC6 (world_wgs84):~ > cat lieb_files_test.txt | while read line; do > > echo $line+" being processed" > > raster=${$line:(-12)} # cut ".nc.lieb.txt" from raster name > > r.in.xyz --overwrite input=$line output=raster method="mean" type="FCELL" > > fs=, x=2 y=1 z=3 > > > ----- > > As you can see, when I press enter after the r.in.xyz line, I just get > another prompt. > > Am I supposed to save it to a separate file and run this as a script? > If so, where should I put this script? > > > 2010/8/10, Saber Razmjooei <razmjoo...@faunalia.co.uk>: > > > > cat list_of_files.txt | while read line; do > > echo $line+"Being processed" # or whaterver you want to do with the > > $line variable > > raster=$line > > r.in.xyz -s -g input=$line output=$line > tmpRegion > > myregion= ""`head -n 1 tmpRegion`" > > g.region $myregion > > r.in.xyz --overwrite input=$line output=$line fs=, > > done > > > > and your list_of_files.txt is > > raster1 > > raster2 > > ..... > > > > Hope that helps > > Saber > _______________________________________________ > grass-user mailing list > grass-user@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-user > _______________________________________________ grass-user mailing list grass-user@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-user