You need to surround your entire sqlite3 command with back tics.


TomaCampo=`sqlite3 /Users/.....and RecordTy8pe='R';"`



That's how you execute a command in bourne shell.





Michael D. Black

Senior Scientist

Advanced Analytics Directorate

Advanced GEOINT Solutions Operating Unit

Northrop Grumman Information Systems

________________________________
From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on 
behalf of Alberto De La Torre [albe...@hidromar.es]
Sent: Monday, December 12, 2011 4:10 PM
To: sqlite-users@sqlite.org
Subject: EXT :[sqlite] Bash Scripting

Hello

I have a problem scripting with sqlite3

I can use, on the same bash the line

sqlite3
/Users/alberto/Documents/Casa/Domótica/Programas/cronizados/WeatherTracker/casa\
Database.sdb "select OutsideTemp from WXData where
RecDateTime>='2011-12-07 21:22' and RecDateTime<='2011-12-07 21:27' and
RecordType='R';"

This gives me the result (being a number)

If I use the same line inside a bash script like:

TomaCampo=sqlite3
/Users/alberto/Documents/Casa/Domótica/Programas/cronizados/WeatherTracker/casa\
Database.sdb "select OutsideTemp from WXData where
RecDateTime>='2011-12-07 21:22' and RecDateTime<='2011-12-07 21:27' and
RecordType='R';"

It raises me up an error:

/Users/alberto/Documents/Casa/Domótica/Programas/cronizados/WeatherTracker/pruebaSqLite:
line 27:
/Users/alberto/Documents/Casa/Domótica/Programas/cronizados/WeatherTracker/casa
Database.sdb: Permission denied

The file "casa Database.sdb" has read rights for owner, group and others

Any ideas how to deal with this matter?

Thank you,

Zenaida
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to