【发布时间】:2026-02-20 18:55:02
【问题描述】:
我有一个 SQLite3 命令文件。例如,
.print "This is running in SQLite3!"
我想要
的行为sqlite3 < commands.sql
当我在 OSX 上运行以下命令时:
./commands.sql
这是我目前的解决方案:
#!/usr/bin/env sqlite3 -init
.print "This is running in SQLite3!"
这可行,但它也会打印一些不需要的行:
-- Loading resources from ./process_errors.sql
Error: near line 1: unrecognized token: "#"
This is running in SQLite3!
【问题讨论】:
标签: macos sqlite executable shebang