Linux 在脚本里面启动终端并执行命令

gnome-terminal -t "title-name" -x bash -c "sh ./shell.sh;exec bash;"-t 为打开终端的标题,
gnome-terminal -t "title-name" -x bash -c "sh ./shell.sh;exec bash;"-t 为打开终端的标题,便于区分。
-x 后面的为要在打开的终端中执行的脚本,根据需要自己修改就行了。
exec bash;是让打开的终端在执行完脚本后不关闭。