X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: <29725859.post@talk.nabble.com> References: <29720777 DOT post AT talk DOT nabble DOT com> <4C9122C1 DOT 7040902 AT towo DOT net> <29725859 DOT post AT talk DOT nabble DOT com> Date: Thu, 16 Sep 2010 12:36:16 +0100 Message-ID: Subject: Re: Security Warning: Re: Behaviours of Terminal Versus Script when using "<<" From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: 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 On 16 September 2010 08:59, delbydev wrote: > The issue is the cmd shell does not handle the inheritance of variables from > the shell to a script without making explicit call within the script to bind > the variables Can you provide simple instructions that demonstrate the issue without requiring a database? By "cmd shell", do you mean Cygwin bash running in a console window, or do you mean the actual Windows command processor (the one that prompts with 'C:\Users\name>'). > The mintty terminal handles this fine as per Typical true bash environments > on UNIX servers > - the cmd shell seems to require another configuration to enable variables > to be inherited in a script from the outer shell - this I don't presently > know how That sounds a bit confused. Let me try to clarify things a bit. Cmd.exe and the console window are not the same thing. Cmd.exe is a command processor, similar in concept (if not implementation) to Unix shells such as bash. They all just take text input and produce text output and they don't concern themselves with displaying a window or anything like that. When you invoke a console application such as cmd.exe or bash.exe from Explorer, Windows automatically creates a console window for it that turns key presses into text input and that display text output on the screen. On Windows 7, that's implemented by conhost.exe. Meanwhile, mintty is similar to conhost.exe in that it sends keyboard input to the program running inside it and displays output coming back from the program. You can set the program to run in it on the mintty command line. By default, that's bash, i.e. no matter whether you invoke the "Cygwin Bash Shell" or the "mintty" shortcut, it's normally bash that's processing your commands. To summarise: Console/terminal: conhost, mintty, rxvt, xterm ... Command processor/shell: cmd, bash, tcsh, zsh, ... There are important differences between Windows consoles and Unix terminals as well, but let's leave those for now ... Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple