Changeset 23 for trunk/libIGCM/libIGCM_card
- Timestamp:
- 10/28/08 18:42:58 (16 years ago)
- Location:
- trunk/libIGCM/libIGCM_card
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_card/IGCM_card_Test.ksh
r5 r23 82 82 83 83 diff ${libIGCM}/libIGCM_card/TestFile.card NewTestFile.card 84 rm -f NewTestFile.card 84 rm -f NewTestFile.card NewTestFile.card.bak 85 85 -
trunk/libIGCM/libIGCM_card/IGCM_card_WriteOption.awk
r5 r23 102 102 END { 103 103 104 if (! exit_value ) {104 if (! exit_value ) { 105 105 106 myprint("###############################") 107 myprint("section ====> " section) 108 myprint("option ====> " option) 109 myprint("value ====> " value) 106 myprint("###############################") 107 myprint("section ====> " section) 108 myprint("option ====> " option) 109 myprint("value ====> " value) 110 111 if (section_found == 0) { 112 print "Error: Section not found", section, option 113 } else if (option_found == 0) { 114 print "Error: Option not found", section, option 115 } 116 117 } else { 110 118 111 if (section_found == 0) { 112 print "Error: Section not found" 113 } else if (option_found == 0) { 114 print "Error: Option not found" 115 } 119 print "Error in with IGCM_WriteOption : ", section, option 116 120 117 }121 } 118 122 119 123 } -
trunk/libIGCM/libIGCM_card/libIGCM_card.ksh
r5 r23 167 167 #D-#================================================================== 168 168 #D-function IGCM_card_WriteOption 169 #D-* Purpose: Write an option froma given file.card and section169 #D-* Purpose: Write an option in a given file.card and section 170 170 #D-* Usage: IGCM_card_WriteOption file.card section newvalue 171 171 #D-* Examples: IGCM_card_WriteOption file.card Recipes Red 150 … … 181 181 typeset tmpfile=tmpfile_$$ 182 182 ( awk -f ${libIGCM}/libIGCM_card/IGCM_card_WriteOption.awk -- "$@" 2> /dev/null ) > ${tmpfile} 183 cp $1 $1.bak 183 184 mv ${tmpfile} $1 184 185 else … … 188 189 fi 189 190 IGCM_debug_PopStack "IGCM_card_WriteOption" 191 } 192 193 #D-#================================================================== 194 #D-function IGCM_card_WriteArrayOption 195 #D-* Purpose: Write an array option a given file.card and section 196 #D-* Usage: IGCM_card_WriteArrayOption file.card section option newarray 197 #D-* Examples: set -A MyArray -- 1 2 3 198 #D- IGCM_card_WriteArrayOption file.card Recipes List MyArray 199 #D- 200 function IGCM_card_WriteArrayOption 201 { 202 IGCM_debug_PushStack "IGCM_card_WriteArrayOption" $@ 203 204 if [ -r "$1" ] && [ -w "$1" ] ; then 205 typeset tmpfile=tmpfile_$$ 206 if [ X"${4}" != X"" ]; then 207 tab=$4 208 IGCM_card_WriteOption $1 $2 $3 '('$( eval echo \${${tab}[@]} | sed -e 's/ /,/g' )')' 209 else 210 IGCM_card_WriteOption $1 $2 $3 '()' 211 fi 212 else 213 echo "--Error--> IGCM_card_WriteArrayOption $@" 214 echo " $1 is not readable or not writable" 215 IGCM_debug_Exit "IGCM_card_WriteArrayOption" 216 fi 217 IGCM_debug_PopStack "IGCM_card_WriteArrayOption" 190 218 } 191 219
Note: See TracChangeset
for help on using the changeset viewer.