![](/img/trans.png)
[英]How to create an Applescript to execute terminal commands and password
[英]How to execute commands in new tabs?
我想启动两个不同的数据库,但希望使每个进程在终端的单独选项卡中运行。 如何在Shell脚本中执行此操作? 我目前有以下代码:
#! /bin/bash
mysqld &
redis-server
每个数据库都需要自己的标签。 这是在OSX上。
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' -e 'tell application "Terminal" to do script "mysqld" in selected tab of the front window'
(基于https://stackoverflow.com/a/7177891/1566267 )
类似的命令用于redis-server
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.