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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM