bash 脚本到 tcl 脚本转换器
我对 TCL 很陌生。我想要一个转换器将 bash 转换为 TCL。您知道有一个转换器可以将 bash 脚本转换为 TCL 脚本吗?
I am very new to TCL. I want a converter to convert bash to TCL. Do you know of a converter that will convert a bash script to a TCL script?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将一种编程语言翻译成另一种编程语言通常是一项极其困难的任务,因为在两个程序之间建立等价性在数学上极具挑战性。唯一的例外是,当某人通过翻译成目标语言来定义源语言时(Tcl 和 Bash 不是这种情况,无论您希望以哪种方式进行翻译!),在中使用惯用的程序就更加困难了。一种语言并转换成另一种语言的惯用程序;成语不要简单地迁移。
也就是说,将特定程序从 Bash 转换为 Tcl 是有可能取得一些进展的,因为功能有相当多的重叠。但它并不是以机械转换为基础;而是以机械转换为基础。这是用手(当然,还有头脑)。
如果脚本很短,取得一些进展的一个简单方法是在展示脚本时询问此处。 (如果有密码,请在显示之前替换密码。)
Translating one programming language into another is in general an ultra-difficult task, because establishing equivalence between two programs is mathematically highly challenging. The only exception is when someone's defined the source language by translation into the target (not the case with Tcl and Bash, whichever way you're looking to do translation!) It's even harder to take idiomatic programs in one language and convert into idiomatic programs in another; idioms don't transfer simply.
That said, it's possible to make some progress with translating specific programs from Bash to Tcl as there's a fair overlap in capabilities. But it's not on a basis of mechanical conversion; it's by hand (and mind, of course).
If the script is pretty short, an easy way to make some progress is to ask here on SO while showing the script. (If it has passwords in, replace those before showing.)