LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Use named fifo to do a useful and funny thing (http://www.linuxquestions.org/questions/linux-newbie-8/use-named-fifo-to-do-a-useful-and-funny-thing-4175430433/)

wang 10-04-2012 02:43 AM

Use named fifo to do a useful and funny thing
 
Hi,friends!

We know that the espeak command can speak out anything you give to it,and I want
to use it to work together with the elinks command to scan any English website with its contents being read at the same time.So,my clever friends,any good ideas?

Still,I wonder if I can just type "myCommand theWebSite" to do it for saving types.

I think this may be related with fifo and alias,but i just can't figure out a method.
Thanks in advance!

henrycoffin 10-05-2012 08:59 AM

Surely espeak would just read out the html code????????

wang 10-11-2012 10:14 AM

Sorry for replying to you so late.
But I am afraid that you have not tried that yet.
Code:

  elinks somesite.com | cat | espeak
That's it.But what I want is to browse the somesite at the same time.
And I wonder if I could divide the flow produced by "elinks somesite.com | cat" into two parts,one for espeak,and the other for stdout,thus listening and reading at the same time.

ntubski 10-12-2012 09:41 AM

cat never divides the flow, it only concatenates files; or, to continue the pipe metaphor, merges files into the flow. For dividing flow you want to use tee. The info page for tee shows some examples using the shell's process substitution.

For your case, it would be something like this:
Code:

elinks somesite.com | tee >(espeak)


All times are GMT -5. The time now is 04:14 AM.