Batch to Bash/Shell Script Converter

2019-03-02 02:20发布

I have recently purchased a Mac and have found out that it does not have any support for Batch (.bat) files at all. All I want is a website that will convert a Batch file program, to a Bash file program so I don't have to learn a whole new programming language, since I am so used to the Batch programming. Is there an online converter or possibly an app/program that could be found on a website or on the Mac App Store. If so, could you please tell me the name of the program, where I can find it, and a link to it. Thanks!

2条回答
We Are One
2楼-- · 2019-03-02 02:54

There is no possible way to do this. Why? Because not only are both the source and destination languages Turing complete, both are hideous piles of accumulated hacks from decades upon decades of maintenance programmers. And not only that, let's say you map all the syntax from Windows Batch to Bash (careful: version 3.2 only, Mac doesn't have newer!). Then what will you do when the original script invokes an external program? Will you know to map Windows Movie Maker to iMovie? Microsoft Office to iWork? Internet Explorer to Safari?

What about the fact that the two different systems have different rules about what constitutes a valid filename? If the source script mentions C:\Windows, what does that mean on a Mac?

There is a never ending amount of work required to do what you're asking. Perhaps you can narrow the scope (a lot).

查看更多
可以哭但决不认输i
3楼-- · 2019-03-02 02:59

This website here claims to have a way to manually do it. But, i do not have any Mac OS X computers to test if its true. Wish i could be more help.

查看更多
登录 后发表回答