[GRASS-user] problem with script started form directory differend than home

Jarekj jarekj at amu.edu.pl
Wed Jul 23 13:04:17 EDT 2008



Glynn Clements pisze:
> Jarekj wrote:
>
>   
>> in the script, which is started from ~/grass/rzeki/
>> I have the problem with line
>> ....
>> v.db.connect -o map='red_'$k driver=dbf 
>> database=~/$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/
>>     
>
> The '~/' at the front of the path shouldn't be there.
>   
It was added by me because in first case (without ~/) I thought that the 
reason is in inappropriate path to table, I forgot to remove it during 
copying
> Also, you need quote the argument; the DBF driver performs run-time
> substitutions of GRASS variables. Without quoting, the shell will try
> to expand them, and they aren't defined. IOW:
>
> 	'database=$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
>   
Yes, that was the reason, thanks!

> Note: you need to use single quotes, as the shell will expand
> variables inside double quotes.
>
>   


More information about the grass-user mailing list