Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ides.UUCP Path: utzoo!linus!decvax!decwrl!amdcad!amd!pesnta!peora!codas!bsdpkh!ides!doug From: doug@ides.UUCP (Douglas J. Wait) Newsgroups: net.unix-wizards Subject: Re: Redirection quirks: 2>&1 >file -- vs. -- >file 2>&1 Message-ID: <146@ides.UUCP> Date: Mon, 6-Jan-86 08:50:11 EST Article-I.D.: ides.146 Posted: Mon Jan 6 08:50:11 1986 Date-Received: Wed, 8-Jan-86 07:14:10 EST References: <649@watmath.UUCP> Organization: AT&T-IS (CSD), Orlando Fl. Lines: 37 > Consider: > > $ command 2>&1 >file > $ command >file 2>&1 > > These are not equivalent using our 4.2bsd Bourne shell. (The 2>&1 in the > first line redirects unit 2 to the tty, not to the file.) > Is this a feature or a bug? Comments not worthy of world-wide > net readership should be mailed to me, not posted, please. > -- > -IAN! (Ian! D. Allen) University of Waterloo Have you read your documentation ? .... Mine tells me that: "... The shell evaluates redirections left-to-right. For example: ... 1>xxx 2>&1 first associates file descriptor 1 with file xxx. It associates file descriptor 2 with the file associated with file descriptor 1 (i.e., xxx). If the order of redirections were reversed, file descriptor 2 would be assocated with the terminal .... This is from SysVr2 sh(1). -- Doug Wait AT&T Information Systems 850 Trafalgar Ct. Maitland, FL 32751 (305)660-3471 ..!{akgua,ihnp4,abcom}!ides!doug "Is anyBODY OUT there..."