Mail Archives: djgpp/2008/03/28/22:45:54
Lets Go Canes wrote:
> CBFalconer <cbfalconer AT yahoo DOT com> wrote:
>>> CBFalconer <cbfalconer AT yahoo DOT com> wrote:
>
> [...]
>
>>>> Of course there is. Just type "cat file | sort | lpr", where you
>>>> have written lpr to take input from stdin and deliver it to the
>>>> printer.`
>
> [...]
>
>> #include <stdio.h>
>>
>> int main(void) {
>> int ch;
>>
>> while (EOF != (ch = getc(stdin))) putc(ch, stdout);
>> return 0;
>> }
>>
>> should do it. Exercise it by setting stdout to point to the
>> printer. Something like "lpr > LPT".
>
> Maybe I am missing something here, but, doesn't the above program
> just add a null pipe element? In other words, if the above program
> is called lpr, I don't understand how "cat file | lpr > LPT" is an
> improvement over "cat file > LPT". Was the intent that more would
> be added to the program ("season to taste")?
Or just "lpr <file >LPT". Flexibility, man. Flexibility.
--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.
--
Posted via a free Usenet account from http://www.teranews.com
- Raw text -