如题所述
ããéè¿shellèæ¬ä¿®æ¹xmlæ件ä¸çæè¡è®°å½
ããè·ä¹åä¸æ ·ï¼å设æå¦ä¸çxmlæ件ï¼
ããweb.xmlä¸æå¦ä¸å 容ï¼
ãã[html] view plain copy
ããcookieName
ããsessionName
ããéæ±ï¼ç°å¨éè¦å©ç¨shellèæ¬æ¿æ¢æcookieName对åºçvalueå¼ï¼
ããå©ç¨shellå®ç°æ¹å¼å¦ä¸ï¼
ããshellèæ¬é¨åï¼
ããdeclare -i Dline
ããgetline()
ãã{
ããgrep -n "cookieName" ${DOMAIN_HOME}/portal/ROOT/WEB-INF/web.xml | head -1 |
cut -d ":" -f 1;
ãã}
ããgetlinenum()
ãã{
ããawk "BEGIN{a=`getline`;b="1";c=(a+b);print c}";
ãã}
ããDline=`getlinenum`;
ããecho "line is ${Dline}";
ããsed -i "${Dline},${Dline}s/.*/ \æ¿æ¢çvalueå¼\<\/param-value\>/g"
path/web.xml
ãã说æï¼è¿ä¸ªè·ä¹åçæ¿æ¢å±æ§æ件çåºå«å¨äºï¼è¿ä¸ªæ¯ç²¾ç¡®å®ä½å°è¡çï¼ç¶åæ¿æ¢æ£è¡codeã
ããè¿ä¸ªxmlåproperties ä¸é½æ¯é»è®¤éè¦æ¿æ¢çå 容æ¯å¯ä¸çã
ããè·ä¹åä¸æ ·ï¼å设æå¦ä¸çxmlæ件ï¼
ããweb.xmlä¸æå¦ä¸å 容ï¼
ãã[html] view plain copy
ããcookieName
ããsessionName
ããéæ±ï¼ç°å¨éè¦å©ç¨shellèæ¬æ¿æ¢æcookieName对åºçvalueå¼ï¼
ããå©ç¨shellå®ç°æ¹å¼å¦ä¸ï¼
ããshellèæ¬é¨åï¼
ããdeclare -i Dline
ããgetline()
ãã{
ããgrep -n "cookieName" ${DOMAIN_HOME}/portal/ROOT/WEB-INF/web.xml | head -1 |
cut -d ":" -f 1;
ãã}
ããgetlinenum()
ãã{
ããawk "BEGIN{a=`getline`;b="1";c=(a+b);print c}";
ãã}
ããDline=`getlinenum`;
ããecho "line is ${Dline}";
ããsed -i "${Dline},${Dline}s/.*/ \æ¿æ¢çvalueå¼\<\/param-value\>/g"
path/web.xml
ãã说æï¼è¿ä¸ªè·ä¹åçæ¿æ¢å±æ§æ件çåºå«å¨äºï¼è¿ä¸ªæ¯ç²¾ç¡®å®ä½å°è¡çï¼ç¶åæ¿æ¢æ£è¡codeã
ããè¿ä¸ªxmlåproperties ä¸é½æ¯é»è®¤éè¦æ¿æ¢çå 容æ¯å¯ä¸çã
温馨提示:答案为网友推荐,仅供参考