Linux OSX外壳脚本打开新终端窗口并运行程序
我正在尝试编写一个简短的shell脚本来打开一个新的终端窗口并启动一个程序。以下是我所拥有的:Linux OSX外壳脚本打开新终端窗口并运行程序,linux,macos,bash,shell,Linux,Macos,Bash,Shell,我正在尝试编写一个简短的shell脚本来打开一个新的终端窗口并启动一个程序。以下是我所拥有的: osascript <<END tell application "Terminal" make new window activate set contents of window to "./hello" & return end tell END osascript类似这样的内容: osascript<<EOF tell applica
osascript <<END
tell application "Terminal"
make new window
activate
set contents of window to "./hello" & return
end tell
END
osascript类似这样的内容:
osascript<<EOF
tell application "System Events"
tell process "Terminal" to keystroke "t" using command down
end
tell application "Terminal"
activate
do script with command "./hello" in window 1
end tell
EOF
osascript命令在新的终端窗口中运行命令:
osascript -e 'tell app "Terminal" to do script "uptime"'