教程
Shell 教程| 菜鸟教程
http://www.runoob.com/linux/linux-shell.html
注意点shell脚本的变量赋值,等号左右均不能有空格
shell脚本的> < 是指示输入输出,不可以比较大小
shell 进行正则表达式判断
#赋值给变量var
read var
#定义regex正则表达式
regex="[0-9]"
if [[ $var =~ $regex]];then
#match
#do something
fi
打开一个app
#打开一个新的chrome页面
open -na "Google Chrome"
#打开一个新的terminal页面
open -na "Terminal"
source tree 增加custom action
#!/bin/sh
REPO_PATH=$1
open -na /Applications/Utilities/Terminal.app $REPO_PATH
参考资料
https://blog.csdn.net/lanyang123456/article/details/52268625
How to open new windows as separate application instances for Chrome, Terminal?
https://apple.stackexchange.com/questions/230390/how-to-open-new-windows-as-separate-application-instances-for-chrome-terminal