当前位置:Gxlcms > 数据库问题 > 用shell脚本创建sqlite表并添加sql语句--通用

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

时间:2021-07-01 10:21:17 帮助过:98人阅读

重要使用的是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   

人气教程排行