html tool

显示标签为“EOF”的博文。显示所有博文
显示标签为“EOF”的博文。显示所有博文

2023年12月25日星期一

shell执行sqlite语句

 参考地址:https://blog.csdn.net/guangdeshishe/article/details/125295529

单条:

sqlite3 ../rule_pcap_80t.db <<EOF >${name}_ignore_key

select ignore_keys from pcap_es_and_ignore_key where pcap_name="${name}" and suuid="S3100109841";

EOF


多条:
sqlite3 ../rule_pcap_80t.db <<EOF >${name}_ignore_key
select ignore_keys from pcap_es_and_ignore_key where pcap_name="${name}" and suuid="S3100109841";
delete  ignore_keys from pcap_es_and_ignore_key where pcap_name="${name}" and suuid="S3100109841";
EOF

转:EOF执行后提示:delimited by end-of-file (wanted `EOF')

 转: https://blog.csdn.net/anzhen0429/article/details/74857168

错误: delimited by end-of-file (wanted `EOF')

原因:结束的EOF后有空格,EOF前后都不应该有空格

转:EOF结果输入到文件

 参考:

https://juejin.cn/s/shell%20eof%20%E8%BE%93%E5%87%BA%E5%88%B0%E6%96%87%E4%BB%B6

#输入到文件

cat << EOF > output.txt This is the first line of the output file.

EOF


#输入追加到文件

cat << EOF >> output.txt This is the first line of the output file.

EOF