Xref: utzoo comp.unix.questions:9380 comp.bugs.4bsd:1019 Path: utzoo!attcan!uunet!mcvax!ukc!stl!stc!root44!aegl From: aegl@root.co.uk (Tony Luck) Newsgroups: comp.unix.questions,comp.bugs.4bsd Subject: Re: more unix jokes - /dev/null Keywords: poor man's Unix Message-ID: <637@root44.co.uk> Date: 22 Sep 88 08:28:03 GMT References: <8488@smoke.ARPA> <26090@ucbvax.BERKELEY.EDU> <1049@sybase.sybase.com> <1414@star.cs.vu.nl> Reply-To: aegl@root44.UUCP (Tony Luck) Organization: UniSoft Ltd, London, England Lines: 28 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 > >:-) This won't work with a well written 'command' as file descriptors 1 and 2 will be open for *reading* not for *writing*. And we all know how careful programs are to check that their writes succeed ... main() { printf("Hello, world\n"); } Oh well perhaps there might be one or two utilities that don't check :-( -Tony Luck (UniSoft Ltd.)