【问题标题】:How to run commands in new terminal windows?如何在新的终端窗口中运行命令?
【发布时间】:2022-06-10 23:15:32
【问题描述】:

我需要在其他终端窗口中运行部分脚本。例如:

# first echo run in terminal window 1
echo "This echo command print in window 1"
# first echo run in terminal window 2
echo "This echo command print in window 2"
# first echo run in terminal window 3
echo "This echo command print in window 3"

请用示例代码回答。

【问题讨论】:

    标签: bash shell terminal


    【解决方案1】:
    xterm -e 'echo "This echo command print in window 1"'
    

    将启动一个 Xterm 窗口并告诉它执行该命令。

    xterm 替换为您正在使用的实际终端程序(例如gnome-terminal)。它也可能使用不同的语法来提供要执行的命令,因此请检查其文档以了解正确的语法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-03-10
      • 2013-10-18
      • 2016-01-29
      • 2021-12-09
      • 2018-09-23
      • 1970-01-01
      相关资源
      最近更新 更多