This is the mail archive of the
cygwin@sources.redhat.com
mailing list for the Cygwin project.
Re: newbie: Out of order execution in script
- To: cygwin at cygwin dot com
- Subject: Re: newbie: Out of order execution in script
- From: Christopher Faylor <cgf at redhat dot com>
- Date: Sat, 2 Dec 2000 22:06:50 -0500
- Cc: schwarza at gdls dot com
- References: <OFE9D19C15.E7A034F8-ON852569A4.00500A62@gdls.com>
- Reply-To: cygwin at cygwin dot com
On Mon, Nov 27, 2000 at 09:34:44AM -0500, schwarza@gdls.com wrote:
>
>---------------------- Forwarded by Arthur I Schwarz/LS/GDYN on 11/27/2000
>09:34 AM ---------------------------
>
>
>Randall R Schulz <rschulz@teknowledge.com> on 11/22/2000 03:04:24 PM
>
>To: schwarza@gdls.com, lhall@rfk.com, cygwin@cygwin.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@sourceware.cygnus.com