This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: newbie: Out of order execution in script

---------------------- 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

Subject:  Re: newbie: Out of order execution in script


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

           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:

exec /bin/bash --login -i
ALLUSERSPROFILE="C:\\Documents and Settings\\All Users"
APPDATA="C:\\Documents and Settings\\Randall R Schulz\\Application Data"
COMMONPROGRAMFILES="C:\\Program Files\\Common Files"

My mail server is spam-blocked (wrongly) so only Larry and Art are
going to see this mail.

I'd like to help resolve this. If you have anything you'd like me to
do to help diagnose the underlying problem, let me know. I've
attached a file containing "cygcheck -s -v" output.


At 13:48 -0500 11/22/00, wrote:
>I have rechecked the results and do not believe that this is
>a Win95 issue.
>The following modified code was executed (bash -x <script> 2>&1 | tee
>     [0] Statements prior to execution of [1]
>     [1] ${importScript} ${importMain} ${tmp}
>     [2] if [ ! -e ${outImp}.imp ] ; then
>     [3]     echo 'ERROR: Unable to find ' ${outImp}.imp
>     [4]    exit
>         fi
>     [5] sed -e '/(/d'                             \
>             -e 's@/kostabi@@'                     \
>             -e 's@^@\ -aI/kostabi@'               \
>             -e 's@/@\\@g'           ${outImp}.imp > ${gnatI}
>It appears that:
>    [1] Was forked.
>    [2] Was immediately executed.
>    [3] Was sequentially executed.
>    [4] Was sequentially executed and the intermediate output for
>        [1] was dumped.
>    [5] Was not executed.
>If I guessed correctly, the fork proceeded in parallel to the main
>script execution. All output (echo) from the forked script was placed
>into a temporary file. The 'echo' in the calling script generated an
>out-of-order output. When the calling script 'exit' was executed, the
>intermediate output stored for the called script was dumped. The trace
>output is included below.
>Am I looking at this the wrong way?
>[0] + echo 'Start processing ' device_control_main  ## executing called
>[0]   Start processing  device_control_main
>[0] + echo

>[0] + /aaav/scripts/ /tmp/386107.gnatmake/import.txt
>###  at this time the called script seems to be executing
>[2] + '[' '!' -e /tmp/386107.gnatmake/device_control_main.imp ']'
>[3] + echo 'ERROR: Unable to find '
>[3] ERROR: Unable to find  /tmp/386107.gnatmake/device_control_main.imp
>[4] + exit
>[1] Main file:  device_control_main
>[1] /aaav/aaav/MPA/build/device_control/
>[1] ... more output
>Want to unsubscribe from this list?
>Send a message to
(See attached file: CygCheck-2000-11-22)


Want to unsubscribe from this list?
Send a message to

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]