Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site rochester.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rochester!ken From: ken@rochester.UUCP (Ipse dixit) Newsgroups: net.unix-wizards Subject: Re: Redirection quirks: 2>&1 >file -- vs. -- >file 2>&1 Message-ID: <14363@rochester.UUCP> Date: Mon, 6-Jan-86 11:40:00 EST Article-I.D.: rocheste.14363 Posted: Mon Jan 6 11:40:00 1986 Date-Received: Tue, 7-Jan-86 07:05:15 EST References: <649@watmath.UUCP> <424@well.UUCP> Reply-To: ken@rochester.UUCP (Ipse dixit) Organization: Sans Serif Lines: 35 Alright you guys, figure this one out then: -------------------- ->> cat d.c main() { printf("Hello world\n"); if (open("/etc/phones", 2) < 0) perror("/etc/phones"); } ->> a.out 2>&1 > xxx /etc/phones: No such file or directory ->> cat xxx Hello world ->> a.out > xxx 2>&1 ->> cat xxx /etc/phones: No such file or directory Hello world ->> 2>&1 a.out > xxx ->> cat xxx /etc/phones: No such file or directory Hello world ->> ------------------- What I really want to know is, what *should* it do? I find sh(1) very uninformative, with some mumble about duplicating file descriptors. Don't get me wrong, I've used Unix for years, but I find the explaination in sh(1) so obtuse that I just look at some old sh files when I want to get work done. Ken -- UUCP: ..!{allegra,decvax,seismo}!rochester!ken ARPA: ken@rochester.arpa Snail: Comp. of Disp. Sci., U. of Roch., NY 14627. Voice: Ken!