Changeset 23 for trunk/libIGCM/libIGCM_card/libIGCM_card.ksh
- Timestamp:
- 10/28/08 18:42:58 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.