从 Ubuntu 17.04 升级到 17.10 后,从命令行-e
启动时,我收到一条警告,提示该选项已弃用gnome-terminal
。例如,假设我想打开一个带有两个选项卡的 gnome 终端,并在每个选项卡中运行单独的命令:
$ gnome-terminal --tab --active -e 'bash -c "echo Hello; exec bash"' --tab -e 'bash -c "echo Hello2; exec 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.
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 --active -- bash -c "echo Hello; exec bash" --tab -- bash -c "echo Hello2; exec bash"
它只打开一个标签。
答案1
我认为以下命令可以帮到您:
gnome-terminal --tab --active -- bash -c "echo Hello; exec bash" && gnome-terminal --tab -- bash -c "echo Hello2; exec bash"