Opening multiple tabs in gnome terminal with complex commands from a cycle
I found the solution: arrays. They can do magic.
# initial arguments
command=(gnome-terminal -e 'command "complex argument"')
...
# add extra arguments
command=("${command[@]}" --tab -e 'command "complex argument2"')
...
# execute command
"${command[@]}"
How to execute multiple commands after opening a new terminal tab
Try this:
gnome-terminal -x bash -c "cmd1; cmd2; …cmdN; exec bash"
How to open a new tab in GNOME Terminal from command line?
#!/bin/sh
WID=$(xprop -root | grep "_NET_ACTIVE_WINDOW(WINDOW)"| awk '{print $5}')
xdotool windowfocus $WID
xdotool key ctrl+shift+t
wmctrl -i -a $WID
This will auto determine the corresponding terminal and opens the tab accordingly.
Open multiple terminal tabs, execute commands and continue working on them
Try this:
gnome-terminal --tab -e 'ls; exec bash'
Or
gnome-terminal --tab -e 'bash -c "ls; exec bash"'
How to choose a default tab focus in gnome-terminal?
I highly recommend installing terminator, it's a program which offers flexible management of multiple running gnome terminals. It allows you to choose a tab as the default focus while still viewing any other amount of terminals on the same view. It can be installed via:
$ sudo apt install terminator
Related Topics
A Way to Prevent Bash from Parsing Command Line W/Out Using Escape Symbols
How to Change the Permissions in Openshift Container Platform
X86_64 Assembly Execve *Char[] Syscall
Escaping Single Quotes in Shell for Postgresql
How to Add Text at the Beginning of Specific Lines Using Sed
Gnu Assembler .Data Section Value Corrupted After Syscall
How to Compile This Asm Code Under Linux with Nasm and Gcc
Bash-Script Error 0=1: Command Not Found
How to Create Shell Variable with Dashes
How to Mail Script Output in Table Format
Why Do I Get /Etc/Cups Conflicts Between Attempted Installs in Yocto
Why Doesn't Set -E Cause a Failure with 'False || False && True'
Hash ("#") Symbol in /Etc/Environment Causes String to Be Split
Difference Between Source and ./ Execution of Linux Scripts
"Command Not Found" Piping a Variable to Cut When Output Stored in a Variable
Wc -M in Unix Adds One Character
Differencebetween These Two Commands Which Are Used to Run Shell Script