0
A
回答
1
你可以写一个shell脚本来完成所有这些。如果您不想在登录SSH服务器时手动输入密码,那么您可以将密钥作为不需要密码的授权密钥(如果配置正确的话)放在远程服务器上。
This page显示了如何使用AppleScript打开终端,给它焦点,打开4个标签等。您可以修改它为您的目的。
下面的AppleScript激活终端,创建一个新的标签,并在第二个选项卡执行“your_command”(剧本,你想要做什么):
on menu_click(mList)
local appName, topMenu, r
-- Validate our input
if mList's length < 3 then error "Menu list is not long enough"
-- Set these variables for clarity and brevity later on
set {appName, topMenu} to (items 1 through 2 of mList)
set r to (items 3 through (mList's length) of mList)
-- This overly-long line calls the menu_recurse function with
-- two arguments: r, and a reference to the top-level menu
tell application "System Events" to my menu_click_recurse(r, ((process appName)'s (menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))
end menu_click
on menu_click_recurse(mList, parentObject)
local f, r
-- `f` = first item, `r` = rest of items
set f to item 1 of mList
if mList's length > 1 then set r to (items 2 through (mList's length) of mList)
-- either actually click the menu item, or recurse again
tell application "System Events"
if mList's length is 1 then
click parentObject's menu item f
else
my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f)))
end if
end tell
end menu_click_recurse
tell application "Terminal"
activate
my menu_click({"Terminal", "Shell", "New Tab", "Pro"})
set window_id to id of first window whose frontmost is true
do script "your_command" in tab 2 of window id window_id of application "Terminal"
end tell
0
看一看Terminitor。它的重点是设置每个项目的终端,但配置可以保存在一个文件中并随意运行。
如果不能证明是有益的,一为AppleScript的由@netrom
0
提到的命令添加到您的〜/ .bashrc文件,并确保它每次都拼命地跑启动终端:
首选项> Shell>启动>标记:运行命令并键入:source〜/ bashrc
相关问题
- 1. PHP - 终端/命令行 - Mac
- 2. Mac终端“重置”命令
- 3. 自动化中的Mac OSX终端命令
- 4. 自动化简单的终端命令
- 5. Mac终端自动完成
- 6. 在Mac终端命令JavaScriptMVC应用
- 7. 的zipalign - 找不到命令 - MAC终端
- 8. MAC命令来运行终端
- 9. 备份mac osx终端命令历史
- 10. (MAC)终端确定运行命令
- 11. 终端命令
- 12. Bash编程 - 创建自定义终端命令 - Mac
- 13. 在mac osx启动NetBeans时运行终端命令
- 14. FileMaker终端命令
- 15. Tomcat终端命令
- 16. Telnet /终端命令
- 17. 使用命令自动重命名终端标签
- 18. 使用bash_profile自定义终端命令
- 19. -in命令在终端复杂命令
- 20. 命令启动的彩色终端线
- 21. 如何在终端中自动设置Python命令和其他任何命令?
- 22. OS X的终端命令
- 23. Linux终端SCREEN命令
- 24. PostgreSQL的psql终端命令
- 25. 禁用终端命令
- 26. 记录终端命令* nix
- 27. “设置 - ”命令,在终端
- 28. 终端重定向命令
- 29. 执行终端命令
- 30. 命令行串行终端