Xref: utzoo comp.unix.questions:9287 comp.bugs.4bsd:1000 Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!pasteur!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!hp4nl!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.unix.questions,comp.bugs.4bsd Subject: Re: more unix jokes - /dev/null Keywords: poor man's Unix Message-ID: <811@philmds.UUCP> Date: 19 Sep 88 19:56:41 GMT References: <8488@smoke.ARPA> <26090@ucbvax.BERKELEY.EDU> <1049@sybase.sybase.com> <1414@star.cs.vu.nl> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 43 In article <1414@star.cs.vu.nl> maart@cs.vu.nl (Maarten Litmaath) writes: >If one wants to run a command with output getting discarded, the obvious >solution is: > > command > /dev/null > >But what would you do if you happened to have no such device? :-) >Is the intended still possible? > >Yes! (Better use the Bourne shell.) > > > command 1< /etc/passwd 2<&1 > >:-) Maybe I'm missing something here, but this redirection also screws up your input (is that the joke perhaps 8-). Try cat for command. After the first line has been typed (from your terminal), the command finishes. But if you run the Bourne shell, you can also do something like: command >&- or command 2>&- which closes the standard output, resp. the standard error for 'command'. Or you can even do exec >&- 2>&- and don't have to worry about output anymore ;-) ! This one's nice too: exec <&- And now I give back the pipe to Maarten (a Dutch phrase that sounds like redirection 8-). Leo.