#
# 检验sqlite3是否可用
#
sqlite3ver=`sqlite3 --version > /dev/null 2>&1`
sqlite3_ok="yes"
if [ $? -ne 0 ]; then
sqlite3_ok="no"
echo -e "\033[31m Not found\033[1;34m sqlite3\033[31m in host, verify failed ! \\033[0m ***"
else
sqlite3ver=`sqlite3 --version | grep "3\.[0-9.]\+\s[0-9-]\{2,\}[0-9]\+\s[0-9:]\{2,\}[0-9]\+\s[0-9a-fA-Z]\+"`
if [ $? -ne 0 ]; then
sqlite3_ok="no"
echo -e "\033[1;34m sqlite3's\033[31m version isn't correct, verify failed ! \\033[0m ***"
fi
fi
#
# 在脚本中, 使用sqlite3检查android程序生成的数据库是否OK
#
在脚本程序中调用sqlite3即可 [以下例子参考:android SQLite3命令详解教程 http://mobile.51cto.com/android-320675.htm]
sqlite3 mydb "create table tbl1(one varchar(10), two smallint)"
sqlite3 mydb "insert into tbl1 values('hello!',10)"
sqlite3 mydb "insert into tbl1 values('goodbye', 20)"
sqlite3 mydb "select * from tbl1"
hello!|10
# 检验sqlite3是否可用
#
sqlite3ver=`sqlite3 --version > /dev/null 2>&1`
sqlite3_ok="yes"
if [ $? -ne 0 ]; then
sqlite3_ok="no"
echo -e "\033[31m Not found\033[1;34m sqlite3\033[31m in host, verify failed ! \\033[0m ***"
else
sqlite3ver=`sqlite3 --version | grep "3\.[0-9.]\+\s[0-9-]\{2,\}[0-9]\+\s[0-9:]\{2,\}[0-9]\+\s[0-9a-fA-Z]\+"`
if [ $? -ne 0 ]; then
sqlite3_ok="no"
echo -e "\033[1;34m sqlite3's\033[31m version isn't correct, verify failed ! \\033[0m ***"
fi
fi
#
# 在脚本中, 使用sqlite3检查android程序生成的数据库是否OK
#
在脚本程序中调用sqlite3即可 [以下例子参考:android SQLite3命令详解教程 http://mobile.51cto.com/android-320675.htm]
sqlite3 mydb "create table tbl1(one varchar(10), two smallint)"
sqlite3 mydb "insert into tbl1 values('hello!',10)"
sqlite3 mydb "insert into tbl1 values('goodbye', 20)"
sqlite3 mydb "select * from tbl1"
hello!|10
goodbye|20