Changeset 286


Ignore:
Timestamp:
06/03/10 19:00:18 (14 years ago)
Author:
mmaipsl
Message:

Suppress default use of '-e' parameter to echo because it doesn't work on all systems.
Use explicit ANSI colors when '-e' is passed to IGCM_debug_Print function as second argument.
Use that behaviour in TimeSeries_Checker and clean_month scripts.

Location:
trunk/libIGCM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_TimeSeries_Checker

    r272 r286  
    230230                            SuccessRate=$(( countGood * 100 / countTotal )) 
    231231                            if [ ! ${SuccessRate} = 100 ] ; then 
    232                                 IGCM_debug_Print 2 "\033[1;31m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}" 
     232                                IGCM_debug_Print 2 -e "\033[1;31m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}" 
    233233                            else 
    234                                 IGCM_debug_Print 2 "\033[1;32m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}" 
     234                                IGCM_debug_Print 2 -e "\033[1;32m${SuccessRate}% files OK.\033[m for period ${ChunckDebut}-${ChunckFin}" 
    235235                            fi 
    236236 
    237237                            echo 
    238238                            if ( [ ${chunck} = true ] && [ ! ${SuccessRate} = 100 ] ) ; then 
    239                                 IGCM_debug_Print 2 "\033[1;31mSubmit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin}" 
     239                                IGCM_debug_Print 2 -e "\033[1;31mSubmit ${FILE} chunck ${Dimension}\033[m period ${ChunckDebut}-${ChunckFin}" 
    240240                                listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,TsTask,CompToRead,FlagToRead" 
    241241                                export libIGCM=${libIGCM} 
     
    288288 
    289289if [ X${Launch2D} = Xtrue ] ; then 
    290     IGCM_debug_Print 2 "\033[1;31mSubmit 2D\033[m without chunck period ${DateBegin}-${DateEnd}" 
     290    IGCM_debug_Print 2 -e "\033[1;31mSubmit 2D\033[m without chunck period ${DateBegin}-${DateEnd}" 
    291291    listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,TsTask" 
    292292    export libIGCM=${libIGCM} 
     
    304304 
    305305if [ X${Launch3D} = Xtrue ] ; then 
    306     IGCM_debug_Print 2 "\033[1;31mSubmit 3D\033[m without chunck period ${DateBegin}-${DateEnd}" 
     306    IGCM_debug_Print 2 -e "\033[1;31mSubmit 3D\033[m without chunck period ${DateBegin}-${DateEnd}" 
    307307    listVarEnv="libIGCM,SUBMIT_DIR,POST_DIR,DateBegin,PeriodDateEnd,TsTask" 
    308308    export libIGCM=${libIGCM} 
  • trunk/libIGCM/AA_clean_month

    r273 r286  
    9191 
    9292    PeriodDateEnd=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateEnd} ) 
    93     CountListFiles=$( IGCM_sys_RshArchive "find ${R_SAVE} -name \"*${PeriodDateEnd}*\"" | wc -l) 
    94     IGCM_sys_RshArchive "find ${R_SAVE} -name \"*${PeriodDateEnd}*\" -ls" 
     93    echo "Search files with ${PeriodDateEnd} in ${R_SAVE}" 
     94    set +A ListFiles -- $( IGCM_sys_RshArchive "find ${R_SAVE} -name \"*${PeriodDateEnd}*\" " ) 
     95    CountListFiles=${#ListFiles[@]} 
    9596 
    96     echo "Number of files to be erased : ${CountListFiles}." 
     97    IGCM_debug_Print 1 "Number of files to be erased : ${CountListFiles}." 
    9798    if [ ${CountListFiles} -gt 0 ] ; then  
    98         echo "Do you REALLY want to erase all those files ?" 
    99         echo -n " Your answer (y/n) : " 
     99        for file in ${ListFiles[@]} ; do 
     100            IGCM_debug_Print 2 -e "\033[1;31m ${file}\033[m" 
     101        done 
     102 
     103        echo "\033[1;32mDo you REALLY want to erase all those files ?" 
     104        echo -n " Your answer (y/n) : \033[m" 
    100105        read reponse 
    101106        case ${reponse} in 
     
    114119    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/run.card Configuration PeriodState 
    115120    if ( [ ${run_Configuration_PeriodState} != "Running" ] && [ ${run_Configuration_PeriodState} != "OnQueue" ] && [ ${run_Configuration_PeriodState} != "Continue" ] ) ; then 
    116         echo "NOW do you to run again (clean run.card) ?" 
    117         echo -n " Your answer (y/n) : " 
     121        echo -e "\033[1;32mNOW do you to run again (clean run.card) ?" 
     122        echo -n -e " Your answer (y/n) : \033[m" 
    118123        read reponse 
    119124        case ${reponse} in 
  • trunk/libIGCM/libIGCM_debug/libIGCM_debug.ksh

    r271 r286  
    237237    shift 
    238238 
     239    if [ X"${1}" = X"-e" ]; then 
     240        typeset cmd_echo="echo -e" 
     241        shift 
     242    else 
     243        typeset cmd_echo="echo" 
     244    fi 
     245 
    239246    if [ ${level} -le ${Verbosity} ] ; then 
    240247        typeset i 
    241248        case "${level}" in 
    242249            1) for i in "$@" ; do 
    243                     echo -e "--Debug1-->" ${i} 
     250                    ${cmd_echo} "--Debug1-->" ${i} 
    244251              done ;;  
    245252            2) for i in "$@" ; do 
    246                     echo -e "--------Debug2-->" ${i} 
     253                    ${cmd_echo} "--------Debug2-->" ${i} 
    247254              done ;;  
    248255            3) for i in "$@" ; do 
    249                     echo -e "--------------Debug3-->" ${i} 
     256                    ${cmd_echo} "--------------Debug3-->" ${i} 
    250257              done ;;  
    251258        esac 
Note: See TracChangeset for help on using the changeset viewer.