![](/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.