Xref: utzoo comp.unix.questions:7808 comp.unix.wizards:9629 Path: utzoo!attcan!uunet!husc6!mailrus!tut.cis.ohio-state.edu!bgsuvax!denbeste From: denbeste@bgsuvax.UUCP (William C. DenBesten) Newsgroups: comp.unix.questions,comp.unix.wizards Subject: Re: /dev/stdin Message-ID: <2468@bgsuvax.UUCP> Date: 27 Jun 88 14:59:47 GMT References: <4096@pasteur.Berkeley.Edu> Distribution: na Organization: Bowling Green State University B.G., Oh. Lines: 24 From article <4096@pasteur.Berkeley.Edu>, by newcomb@cory.Berkeley.EDU (Tom Newcomb): > So, if all you want is the TTY input, why not use /dev/tty? It's worked > beautifully in all the cases I've tried. So, what am I missing? Can anybody > come up with a case where /dev/stdin would NOT be /dev/tty, besides shell > scripts? sure. ls -1 | sort -r - The dash at the end indicates to sort that it should do a fdopen(0). The problem is that this causes ugly special case code within sort. If I instead said: ls -1 | sort -r /dev/stdin the OS would deal with the fact that I want stdin. This would clean up code, since the file opening code can be located in just one place. In addition, you could then pipe input into programs that were not designed to use standard input. -- William C. DenBesten denbeste@bgsu.edu