字符串分割
1 #!/bin/bash 2 pwd=$(dirname $0) && cd ${pwd} 3 4 echo ================ [ $(date "+%F %T") BEGIN ] ======================= 5 6 sms_list="18610489065,13581697175,18600276158,18600574510,18600883672" 8 content="fuck" 9 10 if [[ -n "${content}" ]]; 11 then 12 for number in ${sms_list//18600276158/ } 13 do 14 echo ${number} 15 done 16 fi 17 18 19 echo ================ [ $(date "+%F %R") END ] =======================
[web@SJSWT42-199 engineB_load_monitor]$ sh load_monitor_rong.sh ================ [ 2013-04-18 15:21:26 BEGIN ] ======================= 18610489065,13581697175, ,18600574510,18600883672 ================ [ 2013-04-18 15:21 END ] =======================
sed "/<html>/i<%%>" all.jsp
就可以实现在<html>的前面添加
<%%>
sed "<html>/a<%%>" all.jsp
在<html>的后面插入(追加)
<%%>
sed s/"<li><a href = \"\/monitorSystem\/userMan\">用户管理<\/a><\/li>"/"fuck"/g *
将<li><a href = "/monitorSystem/userMan">用户管理</a></li> 替换为fuck