Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Mac中运行.bash文件?_Bash_Macos - Fatal编程技术网

如何在Mac中运行.bash文件?

如何在Mac中运行.bash文件?,bash,macos,Bash,Macos,要使其在单击时可执行,请创建一个.command文件 拥有 给定chmode+x对它的权限 但似乎有点不对劲,代码没有被执行 我的目标是在双击时创建一个批处理/bash文件,它应该打开终端并执行两个或更多命令。Shebang以#开始不是# I want to execute Path : "/Users/Trans/Downloads/solr-6.1.0" Command: "bin/solr start -p 8983" and Path : " /Users/Trans/Downloa

要使其在单击时可执行,请创建一个.command文件 拥有

给定chmode+x对它的权限 但似乎有点不对劲,代码没有被执行

我的目标是在双击时创建一个批处理/bash文件,它应该打开终端并执行两个或更多命令。

Shebang以
#开始不是
#

I want to execute 
Path : "/Users/Trans/Downloads/solr-6.1.0"
Command: "bin/solr start -p 8983"
and 
Path : " /Users/Trans/Downloads/apache-activemq-5.12.0/bin"
Command: "./activemq console"
 !#/bin/bash
 "/Users/Trans/Downloads/solr-6.1.0" bin/solr start -p 8983
 "/Users/Trans/Downloads/apache-activemq-5.12.0/bin" ./activemq console
#!/bin/bash

# verbose mode ( or -v in shebang )
set -v

cd "/Users/Trans/Downloads/solr-6.1.0" && bin/solr start -p 8983
echo "press a key to continue"
read -n1

cd "/Users/Trans/Downloads/apache-activemq-5.12.0/bin" && ./activemq console
echo "press a key to continue"
read -n1