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"
要在单击时使其可执行,我创建一个.command文件 有
!#/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
给予chmode + x权限 但似乎有些事情是错的,Code没有被执行。
我的目的是创建一个批处理/重击文件,双击它应该打开终端并执行两个命令或更多。
答案 0 :(得分:1)
Shebang以#!
而不是!#
#!/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