Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
aa=$( ps -e   | grep "chrome" | awk '{print $1;}')
for i in $aa
     gnome-terminal --tab -e" sudo cpulimit -p $i -l 35 " 

i want to open one gnome window before the execution of the iteration ,and then use something like --tab -e "", inside the loop to open all in the main gnome window ,and to be all tabbed.In code above, it works but it will open an independent gnome terminal for each iteration of the loop, and i dont want it to be like this

i tried this but it gives me error

aa=$( ps -e   | grep "chrome" | awk '{print $1;}')
for i in $aa
         --tab -e" sudo cpulimit -p $i -l 35 " 

Any suggestions ? Regards

share|improve this question
up vote 1 down vote accepted

I don't see --tab option in gnome-terminal man page. But for example:

tab="--tab-with-profile=Default "
for i in 1 2 3 4 5
   foo="$foo $tab"         
gnome-terminal $foo
share|improve this answer
i get what u want to say , u want to write it the whole command n string variable then execute it all in one gnome terminal below – Ahmed Zain El Dein Apr 30 '13 at 10:23
nice one :) , although i focused on how to make it with gnome terminal command to make gnome terminal window opened and open tabs in it elsewhere i want but really good one – Ahmed Zain El Dein Apr 30 '13 at 10:25
Yep. And also you may be interested in terminal multiplexer tmux that provides much more flexibility than gnome-terminal tabs. – sorgel Apr 30 '13 at 10:39
by the way do u know where ubuntu save in etc the configuration file for nice -n – Ahmed Zain El Dein Apr 30 '13 at 10:43
As I know, there is no configuration file for nice. – sorgel Apr 30 '13 at 10:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.