shell 脚本的编译器 [英] Compilers for shell scripts

查看:101
本文介绍了shell 脚本的编译器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你知道是否有编译 bash 脚本的工具吗?

Do you know if there's any tool for compiling bash scripts?

该工具是否只是一个翻译器(例如,将 bash 脚本转换为 C 程序的工具)并不重要,只要翻译的结果可以编译即可.

It doesn't matter if that tool is just a translator (for example, something that converts a bash script to a C program), as long as the translated result can be compiled.

我正在寻找类似 shc (这只是一个例子——我知道 shc 不能作为编译器工作).还有其他类似的工具吗?

I'm looking for something like shc (it's just an example -- I know that shc doesn't work as a compiler). Are there any other similar tools?

推荐答案

Google 搜索显示 CCsh,但每台机器需要 50 美元才能获得许可证.

A Google search brings up CCsh, but it will set you back $50 per machine for a license.

文档说 CCsh 将 Bourne Shell(而不是 bash ...)脚本编译为 C 代码,并且它了解如何复制 50 多个标准命令的功能,而无需 fork 它们.

The documentation says that CCsh compiles Bourne Shell (not bash ...) scripts to C code and that it understands how to replicate the functionality of 50 odd standard commands avoiding the need to fork them.

但 CCsh 不是开源的,因此如果它不能满足您的需求(或期望),您将无法查看源代码来找出原因.

But CCsh is not open source, so if it doesn't do what you need (or expect) you won't be able to look at the source code to figure out why.

这篇关于shell 脚本的编译器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆