X-Spam-Check-By: sourceware.org Message-ID: From: "Buzz" Subject: Re: Shell (bash, (pd)ksh, zsh, /not/ ash) + exec + here-doc + redirect == trouble! References: <012520062028 DOT 10525 DOT 43D7DF6F0008E6E60000291D22007507840A050E040D0C079D0A AT comcast DOT net> Reply-To: cygwin mailing-list Organisation: Ehm... User-Agent: slrn/0.9.8.1 (Win32) Hamster/2.1.0.0 KorrNews/4.2.1 To: cygwin AT cygwin DOT com In-Reply-To: <012520062028.10525.43D7DF6F0008E6E60000291D22007507840A050E040D0C079D0A@comcast.net> Lines: 42 Date: Fri, 27 Jan 2006 04:08:47 +0100 (MET) X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com [No need to Cc me.] Op Wed, 25 Jan 2006 20:28:32 +0000 schreef Eric Blake in <012520062028.10525.43D7DF6F0008E6E60000291D22007507840A050E040D0C079D0Acomcast.net>: [Adding attrib to self:] : Buzz: : > I (now) understand what's happening. I think it's undesirable, though. : : That's a relative viewpoint. Personally, I like the fact that : the rules are consistent (process instructions one line at : a time; and apply pipelines first, then apply all redirections, : including here-docs, in left-to-right order), and that the : rules allow you to save stdin without having it be fd 0 Sure, but to have the shell redirect /it's own/ input instead of the input of it's sub-commands is counter-intuitive _and_ counter- productive IMO. I like to write things like: exec sh 5<&0 <