在Mac OS蝙蝠的等效 [英] Equivalent of .bat in mac os

查看:206
本文介绍了在Mac OS蝙蝠的等效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用的是被用来调用Java文件中的的.bat 文件。如果我想利用在Mac OS相同的功能我会做出什么样的格式变化? (除非在Mac OS上的的.bat 相当于是 .SH 格式?)

I currently use a .bat file that is utilized to invoke a java file. If I wanted to utilize the same functionality on Mac OS what format changes would I make? (unless the .bat equivalent on Mac OS is the .sh format?)

java -cp  ".;.\supportlibraries\Framework_Core.jar;.\supportlibraries\Framework_DataTable.jar;.\supportlibraries\Framework_Reporting.jar;.\supportlibraries\Framework_Utilities.jar;.\supportlibraries\poi-3.8-20120326.jar;D:\downloads\Selenium 2.0\selenium-server-standalone-2.19.0.jar" allocator.testTrack

任何援助将AP preciated。

Any assistance would be appreciated.

推荐答案

可能是你能找到答案吗? <一href=\"http://stackoverflow.com/questions/589905/equivalent-of-double-clickable-sh-and-bat-on-mac\">Equivalent双点击.SH和.bat在Mac?

May be you can find answer here? Equivalent of double-clickable .sh and .bat on Mac?

通常你可以在Mac OS,在那里你把类似的命令在批处理文件创建bash脚本。对于您的情况下创建的bash文件,并把同样的命令,但换回来,斜线与常规的。

Usually you can create bash script for Mac OS, where you put similar commands as in batch file. For your case create bash file and put same command, but change back-slashes with regular ones.

您文件看起来是这样的:

Your file will look something like:

#! /bin/bash
java -cp  ".;./supportlibraries/Framework_Core.jar;./supportlibraries/Framework_DataTable.jar;./supportlibraries/Framework_Reporting.jar;./supportlibraries/Framework_Utilities.jar;./supportlibraries/poi-3.8-20120326.jar;PATH_TO_YOUR_SELENIUM_SERVER_FOLDER/selenium-server-standalone-2.19.0.jar" allocator.testTrack

在路径更改文件夹上面相关的。

Change folders in path above to relevant one.

然后,让这个脚本可执行:打开终端并导航与你的脚本文件夹中。然后换读 - 写 - 执行该文件运行命令的权利:

Then make this script executable: open terminal and navigate to folder with your script. Then change read-write-execute rights for this file running command:

chmod 755 scriptname.sh

然后就可以像任何其他楷书运行它:
    ./scriptname.sh

Then you can run it like any other regular script: ./scriptname.sh

也可以运行它传递文件打坏:

or you can run it passing file to bash:

bash scriptname.sh

这篇关于在Mac OS蝙蝠的等效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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