Possible Duplicate:
What is the easiest way to execute text from tail at the command line?
I was guessing the ouput of a command that fails to execute should be sent to stdout and hence can be piped. It seems I am wrong, so please correct me.
For example,
$easy_install
The program 'easy_install' is currently not installed. You can install it by typing:
sudo apt-get install python-setuptools
So if I want to install with the command suggested, I tried
$easy_install | grep sudo | bash
i.e naively trying to pick out the last line and send it to the shell as a command. I even tried
$easy_install | tail -1 | bash
but get the same blurb without it doing anything. What am I doing wrong?
sudo apt-get install python-setuptools
and be done with it. – jw013 Apr 8 '12 at 4:00man xargs
to get an idea. – Keith Apr 8 '12 at 9:51