孤零零的画着哭脸

导航

用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结束

posted on 2017-03-10 21:33  孤零零的画着哭脸  阅读(3047)  评论(0)    收藏  举报