Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sat, 2 Dec 2000 22:06:50 -0500 From: Christopher Faylor To: cygwin AT cygwin DOT com Cc: schwarza AT gdls DOT com Subject: Re: newbie: Out of order execution in script Message-ID: <20001202220650.A19416@redhat.com> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com, schwarza AT gdls DOT com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: ; from schwarza@gdls.com on Mon, Nov 27, 2000 at 09:34:44AM -0500 On Mon, Nov 27, 2000 at 09:34:44AM -0500, schwarza AT gdls DOT com wrote: > >---------------------- Forwarded by Arthur I Schwarz/LS/GDYN on 11/27/2000 >09:34 AM --------------------------- > > >Randall R Schulz on 11/22/2000 03:04:24 PM > >To: schwarza AT gdls DOT com, lhall AT rfk DOT com, cygwin AT cygwin DOT com >cc: >Subject: Re: newbie: Out of order execution in script > >Hi, > >I've got an analogous problem under Windows 2000 Pro SP1. The problem >began occurring in previously working BASH function when I upgraded >to Cygwin 1.1.5. It is still happening in 1.1.6. > >Here's the shell function definition whose "side-effects" on the file >".logon" occur out of order: > >logon() { > if [ -n "$(jobs)" ]; then > echo "There are stopped jobs." >&2 > return 1 > fi > > cd > echo "#!/bin/sh" >|.logon > cat .env-initial >>.logon > echo "exec /bin/bash --login -i" >> .logon > exec -lc .logon >} > >After running this function the "exec /bin/bash --login -i" line is >the second line in the file (the #! line comes first). Here are the >first few lines of ".logon" after the logon function is executed: > >-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==- >#!/bin/sh >exec /bin/bash --login -i >ALLUSERSPROFILE="C:\\Documents and Settings\\All Users" >APPDATA="C:\\Documents and Settings\\Randall R Schulz\\Application Data" >CLASSPATH="C:\\WINNT\\System32\\QTJava.zip" >COMMONPROGRAMFILES="C:\\Program Files\\Common Files" >COMPUTERNAME="CLEMENS" >COMSPEC="C:\\WINNT\\system32\\cmd.exe" >-==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==--==- How are you running this function? I've tried this many many times on many different machines and I always get the desired effect. I've tried creating a simple script with just that function and a "logon" and everything works correctly. I've tried typing "logon" from bash and everything works. Is this function part of a .profile? Do you just type 'logon' at the bash command prompt? Can you duplicate this problem under strace? strace -b16384 -osomefile -f bash If so, please send 'somefile' to this mailing list. Thanks. cgf -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com