【问题标题】:Run script in new tab in gnome terminal [duplicate]在 gnome 终端的新选项卡中运行脚本 [重复]
【发布时间】:2019-09-28 05:02:50
【问题描述】:

到目前为止,我有这个有效的命令

gnome-terminal --tab -e '/bin/bash -c "ls";bash'

但是有一个警告

# Option “-e” is deprecated and might be removed in a later version of gnome-terminal.
# Use “-- ” to terminate the options and put the command line to execute after it.

当我把它改成

gnome-terminal --tab -- '/bin/bash -c "ls";bash'

新标签页失败

There was an error creating the child process for this terminal
Failed to execute child process “/bin/bash -c "ls";bash” (No such file or directory)

【问题讨论】:

    标签: bash shell ubuntu gnome-terminal


    【解决方案1】:

    原因:

    gnome-terminal --tab -- '/bin/bash -c "ls";bash'
    

    失败是它正在寻找一个以它为名称的程序。这是链加载的一个实例,其中其余参数按原样传递给 exec。第一个参数是程序的名称。通过此引用,它接收整个命令和选项作为单个程序名称。

    将引用改为:

    gnome-terminal --tab -- /bin/bash -c "ls;bash"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-02-28
      • 2021-06-30
      • 2013-10-29
      • 1970-01-01
      • 2013-07-26
      • 2010-11-14
      • 2013-06-18
      • 1970-01-01
      相关资源
      最近更新 更多