This is the mail archive of the cygwin@sources.redhat.com 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
<file>

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


art
---------------------------------------------------------------------

[0] + echo 'Start processing ' device_control_main  ## executing called
script
[0]   Start processing  device_control_main
[0] + echo
/aaav/aaav/MPA/build/device_control/devices.ss/aaav_scm_mpa.rel/device_control_main.adb
[0] + /aaav/scripts/import.sh /tmp/386107.gnatmake/import.txt
/tmp/386107.gnatmake

###  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 '
/tmp/386107.gnatmake/device_control_main.imp
[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/devices.ss/aaav_scm_mpa.rel
[1] ... more output



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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