"gnome-terminal --tab-with-profile=AAA --tab-with-profile=BBB"
Hi I am trying to open several tabs in a gnome-terminal window like above. I want to run a command for each tab within the body of the above command. AAA and BBB are both profiles I have created and also predefined environment variable on my system (each representing a path to a folder). The code I was hoping would work was something like:
"gnome-terminal --tab-with-profile=AAA -e='ls AAA' --tab-with-profile=BBB -e='ls BBB'"
in order to list the folder contents within each tab, but no dice.
Anyone know how to do this in a single command?
Thanks Pete
From: Pete O'Connell pedrooconnell@gmail.com
Hi I am trying to open several tabs in a gnome-terminal window like above. I want to run a command for each tab within the body of the above command. AAA and BBB are both profiles I have created and also predefined environment variable on my system (each representing a path to a folder). The code I was hoping would work was something like:
"gnome-terminal --tab-with-profile=AAA -e='ls AAA' --tab-with-profile=BBB -e='ls BBB'"
in order to list the folder contents within each tab, but no dice.
I think the problem is more that it exits right away and does not seem to accept chained commands with ; or &&... Try with a full script with loops or something like watch: gnome-terminal --tab -e "watch ls /" --tab -e "watch ls /"
JD
HI, but using watch you don't get the cursor back. John Doe said: Try with a full script with loops
Sounds good how do I do that?
Or just use Terminator and broadcast to all split windows or tabs.
-- Tom
On 05 Aug 2011, at 01:50, Pete O'Connell wrote:
HI, but using watch you don't get the cursor back. John Doe said: Try with a full script with loops
Sounds good how do I do that?
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
From: Pete O'Connell pedrooconnell@gmail.com
HI, but using watch you don't get the cursor back.
Because when the command exists, the gnome-terminal session exists... Best would be the following if you find out how to add your commands to the bash call... gnome-terminal --tab -e "bash -i" --tab -e "bash -i" Maybe someone will have an idea...
Try with a full script with loops
Sounds good how do I do that?
Instead of the loops, you could use this script.sh: #!/bin/bash ls $* bash -i
gnome-terminal --tab -e "/path/to/script.sh AAA" --tab -e "/path/to/script.sh BBB"
JD
hi, bash is unavailable to me on my machine unfortunately (it is a work machine) the command must be sent in a tsch shell. any way to do this in tsch?
Pete
From: Pete O'Connell Pedrooconnell@gmail.com
hi, bash is unavailable to me on my machine unfortunately (it is a work machine) the command must be sent in a tsch shell. any way to do this in tsch?
Did you look at tcsh man page? If you did, you must have noticed that it accepts the same '-i' parameter as does bash. So did you just try to replace the bash calls with tcsh calls...?
JD
PS: It is strange that your CentOS server has no bash installed...
Hi swapping out bash for tsch doen't work unfortunately. The window that gets created when you do this only stays open for a split second. You are right, bash is on the Centos server, it is just that the many custom environment variables at my workplace only work in a tsch shell. Anyone know a way of doing this using only tsch?
Pete
From: Pete O\'Connell pedrooconnell@gmail.com
Hi swapping out bash for tsch doen't work unfortunately. The window that gets created when you do this only stays open for a split second.
Works for me with: $ cat test.sh #!/bin/tcsh ls $* /bin/tcsh -i $ gnome-terminal --tab -e "/path/to/test.sh AAA" --tab -e "/path/to/test.sh BBB" Be sure to use the script full path...
JD