Ignore:
Timestamp:
Jun 17, 2009, 11:21:10 PM (15 years ago)
Author:
rosiere
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Script/execute.sh

    r126 r127  
    8888    done < ${FILE_CMD};
    8989
     90    local -i NB_DIGIT=0;
     91    local -i x=${#COMMAND[*]};
     92
     93    while test ${x} -ne 0; do
     94        NB_DIGIT=$((${NB_DIGIT} + 1));
     95        x=$((${x} / 10));
     96    done;
     97
    9098    echo "  * {"$(my_date)"} <${ID}> is ready";
    9199
     
    127135        # Test if command is empty !
    128136        if test ! -z "${COMMAND[${CPT}]}"; then
    129 #           echo "  * {"$(my_date)"} <${ID}> execute command [${CPT}] : ${COMMAND[${CPT}]}";
    130             echo "  * {"$(my_date)"} <${ID}> command [${CPT}] : execute";
     137            local NUM=$(printf %.${NB_DIGIT}d ${CPT});
     138
     139#           echo "  * {"$(my_date)"} <${ID}> execute command [${NUM}] : ${COMMAND[${CPT}]}";
     140            echo "  * {"$(my_date)"} <${ID}> command [${NUM}] : execute";
    131141            local PATH_CURRENT=${PWD};
     142
    132143            cd    ${PATH_WORK}        &> /dev/null;
    133             mkdir "Task_${CPT}"       &> /dev/null;
    134             cd    "Task_${CPT}"       &> /dev/null;
     144            mkdir "Task_${NUM}"       &> /dev/null;
     145            cd    "Task_${NUM}"       &> /dev/null;
    135146            echo "id   : ${ID}"        >  ${OUTPUT_FILE_INFO};
    136147            echo "host : ${HOSTNAME}" >>  ${OUTPUT_FILE_INFO};
     
    143154            ./${OUTPUT_FILE_CMD}      &>  ${OUTPUT_FILE_OUT};
    144155            cd    ${PATH_CURRENT}     &> /dev/null;
    145             echo "  * {"$(my_date)"} <${ID}> command [${CPT}] : done";
     156            echo "  * {"$(my_date)"} <${ID}> command [${NUM}] : done";
    146157        fi;
    147158    done;
Note: See TracChangeset for help on using the changeset viewer.