创建 lisp 脚本文件以从控制台启动时如何使用附加标志
How to use additional flags when creating lisp script file to start from console
我想创建一个 .lisp
文件,我可以将其作为脚本启动,即以 #!/bin/usr/sbcl --script
开头。这很好用。
文件:
#!/usr/bin/sbcl --script
(format t "test~%")
输出:
$> ./test.lisp
test
但是,我还需要调整动态 space 大小才能使该特定脚本正常工作。但这以某种方式阻止了 --script
标志的工作
文件:
#!/usr/bin/sbcl --dynamic-space-size 12000 --script
(format t "test~%")
输出:
$> ./test.lisp
This is SBCL 1.4.5.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
*
如何增加动态 space 大小,同时保持从命令提示符启动 lisp program/script 的便利性?
显然 #!
将命令后面的所有内容视为单个字符串,因此 --dynamic-space-size 12000 --script
被视为一个字符串而不是参数和标志。
我目前的解决方案是创建一个额外的 .sh
文件:
#!/bin/bash
sbcl --dynamic-space-size 12000 --script ./test.lisp $@
然而,这有一个明显的缺点,即需要从与 .lips
文件相同的目录启动脚本。因此,我仍在寻找 'perfect' 解决方案,这是一个权宜之计。
这是 shebang 行的一般限制,而不是 SBCL 特定的限制。
较新的 env
版本(在 GNU 中 — FreeBSD 有更长的时间)理解 -S
选项来拆分参数:
#!/usr/bin/env -S sbcl --dynamic-space-size 9000 --script
我想创建一个 .lisp
文件,我可以将其作为脚本启动,即以 #!/bin/usr/sbcl --script
开头。这很好用。
文件:
#!/usr/bin/sbcl --script
(format t "test~%")
输出:
$> ./test.lisp
test
但是,我还需要调整动态 space 大小才能使该特定脚本正常工作。但这以某种方式阻止了 --script
标志的工作
文件:
#!/usr/bin/sbcl --dynamic-space-size 12000 --script
(format t "test~%")
输出:
$> ./test.lisp
This is SBCL 1.4.5.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
*
如何增加动态 space 大小,同时保持从命令提示符启动 lisp program/script 的便利性?
显然 #!
将命令后面的所有内容视为单个字符串,因此 --dynamic-space-size 12000 --script
被视为一个字符串而不是参数和标志。
我目前的解决方案是创建一个额外的 .sh
文件:
#!/bin/bash
sbcl --dynamic-space-size 12000 --script ./test.lisp $@
然而,这有一个明显的缺点,即需要从与 .lips
文件相同的目录启动脚本。因此,我仍在寻找 'perfect' 解决方案,这是一个权宜之计。
这是 shebang 行的一般限制,而不是 SBCL 特定的限制。
较新的 env
版本(在 GNU 中 — FreeBSD 有更长的时间)理解 -S
选项来拆分参数:
#!/usr/bin/env -S sbcl --dynamic-space-size 9000 --script