And*_*Dev 4 linux macos bash shell
我正在尝试编写一个简短的shell脚本来打开一个新的终端窗口并启动一个程序.这是我有的:
osascript <<END
tell application "Terminal"
make new window
activate
set contents of window to "./hello" & return
end tell
END
Run Code Online (Sandbox Code Playgroud)
执行错误:终端出错:AppleEvent处理程序失败.(-10000)
谁能告诉我怎么做?在一个完美的世界中,我也喜欢这个脚本在Linux上运行,所以如果有一个可移植的方法,那就更好了.
谢谢!
该do script命令在新的终端窗口中运行命令:
osascript -e 'tell app "Terminal" to do script "uptime"'
Run Code Online (Sandbox Code Playgroud)