Changeset 1146 for trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
- Timestamp:
- 11/28/14 15:55:42 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_comp/libIGCM_comp.ksh
r1116 r1146 1280 1280 sed -e "s/\(<[^\"]*\"${keyid}\".*>\)\([^<]*\)\(<[^>]*\)/\1${value}\3/" $filein > $filein.tmp 1281 1281 else 1282 # Case to modify the attribute value 1283 IGCM_debug_Print 1 "Now modify ${filein} for id=${keyid} by setting attribute to ${keyattrib}=${value}" 1284 sed -e "/id=\"${keyid}\"/s/\(${keyattrib}=\"\)[^\"]*\(\"\)/\1${value}\2/" $filein > $filein.tmp 1282 # Check if keyattrib is set on the same line as keyid 1283 if [ $( grep -w $keyid $filein | grep $keyattrib | wc -l ) = 1 ] ; then 1284 # Case to modify the attribute value 1285 IGCM_debug_Print 1 "Now modify ${filein} for id=${keyid} by setting attribute to ${keyattrib}=${value}" 1286 sed -e "/id=\"${keyid}\"/s/\(${keyattrib}=\"\)[^\"]*\(\"\)/\1${value}\2/" $filein > $filein.tmp 1287 else 1288 # Case to add the attribute and its value 1289 IGCM_debug_Print 1 "Now add in ${filein} for id=${keyid} the attribute ${keyattrib} to the value ${value}" 1290 sed -e "/id=\"${keyid}\"/s/\/>/ ${keyattrib}=\"${value}\"\/>/" $filein > $filein.tmp 1291 fi 1285 1292 fi 1286 1293 \mv $filein.tmp $filein
Note: See TracChangeset
for help on using the changeset viewer.