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 " 

when i run it i get error missing argument e i want it when a chrome process get run to get all process related parent and children and safe them in aa variable then i open the gnome terminal to cpulimit one by one , any help pls ?

share|improve this question
up vote 1 down vote accepted

The error should give you a hint: Just add a space after -e.

share|improve this answer
there ıs no hınt just as ı mentıoned sır and ı already put * thank u for replyıng :) Failed to parse arguments: Missing argument for -e – Ahmed Zain El Dein Apr 29 '13 at 19:17
@AhmedZainElDein: You probably misunderstood me. Put a space between -e and "sudo cpulimit .... – choroba Apr 29 '13 at 19:49
yes sir u are right thank u btw i want to ask about final thing i want to open the gnome all taped in one window for every loop not to open gnome window in each iteration so can u help me in this – Ahmed Zain El Dein Apr 29 '13 at 20:00

pgrep is a handy tool to extract PIDs based on a program name:

pgrep chrome | 
while read pid; do
  gksudo cpulimit -p $pid -l 35
share|improve this answer
thank u sir for replying but i want to save it in variable aa= $somevalue to do more further things later using this variable – Ahmed Zain El Dein Apr 29 '13 at 19:21
and i want to make inside the for loop to open gnome terminal and also in each iteration make the open gnome terminal to be tap not in each loop open new independent terminal windows – Ahmed Zain El Dein Apr 29 '13 at 19:40

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.