Free Pascal 有命令行解释器吗?

发布于 2024-12-09 23:30:47 字数 87 浏览 0 评论 0原文

例如,我可以通过在 Pascal 文件中添加 shebang 来使用:

#!/usr/bin/env fpi

E.g., one I could use by adding a shebang to my Pascal files:

#!/usr/bin/env fpi

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

黑凤梨 2024-12-16 23:30:47

fpc的svn trunk处有instantfpc:
http://svn.freepascal.org/svn/fpc/trunk/utils/ instantfpc/

这是自述文件:

instantfpc
==========

This tool allows to execute pascal programs as unix scripts.
A unix script starts with a shebang #! and the program to execute. For example

#!/usr/bin/env instantfpc
begin
  writeln('It works');
end.

If you save the above file as test.pas and set the execute permission
(chmod a+x) you can execute the script simply with
./test.pas


Installation
============

1. Compile instantfpc.lpi using lazarus, lazbuild or via "fpc instantfpc.lpr"
2. Put the executable "instantfpc" in PATH, for example into
   /usr/bin/instantfpc or ~/bin/instantfpc.

That's all.
Now you can execute pascal programs as scripts.

There's instantfpc at fpc's svn trunk:
http://svn.freepascal.org/svn/fpc/trunk/utils/instantfpc/

Here's the README:

instantfpc
==========

This tool allows to execute pascal programs as unix scripts.
A unix script starts with a shebang #! and the program to execute. For example

#!/usr/bin/env instantfpc
begin
  writeln('It works');
end.

If you save the above file as test.pas and set the execute permission
(chmod a+x) you can execute the script simply with
./test.pas


Installation
============

1. Compile instantfpc.lpi using lazarus, lazbuild or via "fpc instantfpc.lpr"
2. Put the executable "instantfpc" in PATH, for example into
   /usr/bin/instantfpc or ~/bin/instantfpc.

That's all.
Now you can execute pascal programs as scripts.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文