在Linux环境下运行的.bat [英] Run .bat in Linux environment

查看:1754
本文介绍了在Linux环境下运行的.bat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法运行在Linux环境下.bat文件?
我有一对夫妇的.bat文件,他们的目的是呼吁MVN安装:安装文件脚本。因此,依赖什么操作系统是在脚本中。

Is there any way to run .bat file in Linux environment? I have a couple of .bat files, the purpose of them is to call mvn install:install-file scripts. Thus nothing OS dependent is in the scripts.

感谢您,

推荐答案

您可以使用 DOSBox中 ,但一般没有已知的蝙蝠间preTER对于Linux。有,但是,各种UNIX外壳适用于Windows的实现,甚至有一个标准的工具包,的Windows Services for UNIX的(又名 SUA ),其中包括 KSH 执行情况和其他许多不错的好东西,所以如果你想要OS-透明的,你可以考虑使用,并在符合POSIX标准的shell脚本语言编写的脚本。

You can use wine or dosbox, but in general there is no known bat interpreter for linux. There are, however, implementations of various unix shells for windows, there's even a standard toolkit, Windows Services for UNIX (a.k.a. SUA), which include ksh implementation and many other nice goodies, so if you want it OS-transparent, you could consider using that and write your scripts in a POSIX-compliant shell scripting language.

---编辑---
在另一方面,如果你的脚本包含的闲来无事的比其他 MVN< PARAMS> ,你可以确保文件具有执行权限( X 标记),与外壳间preTER prePEND它(如 /斌/ bash的script.bat ),并有它一展身手。成功没有保证,虽然。

--- edit --- On the other hand, if your script contains nothing else other than an mvn <params>, you can just make sure the file has execute permissions (x flag), prepend it with a shell interpreter (like /bin/bash script.bat) and have a go at it. Success not guaranteed, though.

这篇关于在Linux环境下运行的.bat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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