Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.
aa=$( ps -e   | grep "chrome" | awk '{print $1;}')
for i in $aa
   do
     gnome-terminal --tab -e" sudo cpulimit -p $i -l 35 " 
   done

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;}')
    gnome-terminal 
for i in $aa
       do
         --tab -e" sudo cpulimit -p $i -l 35 " 
       done

Any suggestions ? Regards

share|improve this question

1 Answer 1

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
   do
   foo="$foo $tab"         
   done
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
1  
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

 
discard

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.