加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

用gforth unix shebang

发布时间:2020-12-16 01:47:39 所属栏目:安全 来源:网络整理
导读:当我在脚本顶部有一个 shebang时,我无法运行 Gforth,例如: #!/usr/bin/gforth: pinoke ." I'm a real boy!!! "pinoke Unix似乎正在推出gForth,但gForth本身在shebang线上窒息.我不确定如何定义一个单词以使Forth以不同方式解释shebang行(不是说它不能完成,
当我在脚本顶部有一个 shebang时,我无法运行 Gforth,例如:

#!/usr/bin/gforth
: pinoke ." I'm a real boy!!! "
pinoke

Unix似乎正在推出gForth,但gForth本身在shebang线上窒息.我不确定如何定义一个单词以使Forth以不同方式解释shebang行(不是说它不能完成,但我只是不确定它是怎么回事).

我已经考虑过使用脚本将代码文件提供给gForth,但是反复做这件事可能相当尴尬.有没有办法让gForth像其他语言一样接受shebang?

解决方法

你需要一个#之间的空间!和/usr/bin/gforth.

见13.7 Running Image Files(在Gforth手册中):

The sequence #! is used in two ways; firstly,it is recognised as a “magic sequence” by the operating system1 secondly it is treated as a comment character by Gforth. Because of the second usage,a space is required between #! and the path to the executable

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读