当前位置:首页 > 数据库 > SQlite

用shell脚本创建sqlite表并添加sql语句--通用

重要使用的是EOF的功能,亲测和!功能一致;下面是测试代码

#!/bin/bash
val=`ls`
for v in ${val}
do
  if [ ${v} == "test.db" ]
  then
  rm test.db
  echo "rm test.db"
  fi
done

sqlite test.db << EOF
create table test(name char,sex char);
insert into test values("yang","nan");
select * from test;
.quit
EOF

EOF注入内容EOF结束

用shell脚本创建sqlite表并添加sql语句--通用

标签:通用   shell脚本   one   insert   结束   shell   shel   添加   into   

本文系统来源:http://www.cnblogs.com/yangzenghui/p/6533186.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!