Я пытаюсь отобразить некоторые многострочные сообщения в sqlite3 с помощью команд echo
, cat
, read
и printf
, но у меня всегда возникают ошибки.Вывод, который я хочу получить:
display the table in a text file:
.once -e
SELECT * from table1;
display the table in a spreadsheet:
.once -x
SELECT * from table1;
Я пробовал это, но каждая команда загромождает вывод:
.shell echo "display the table in a text file:"
.shell echo ".once -e"
.shell echo "SELECT * from table1;"
.shell echo "display the table in a spreadsheet:"
.shell echo ".once -x"
.shell echo "SELECT * from table1;"
Итак, я попытался:
.shell cat << EndOfMessage
display the table in a text file:
.once -e
SELECT * from table1;
display the table in a spreadsheet:
.once -x
SELECT * from table1;
EndOfMessage
;
и:
.shell read -r -d '' VAR << EndOfMessage
display the table in a text file:
.once -e
SELECT * from table1;
display the table in a spreadsheet:
.once -x
SELECT * from table1;
EndOfMessage
;
.shell echo "$VAR"
но оба дают несколько ошибок.