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

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


    [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

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