各タグ間の残りの行に追加する必要があります。

各タグ間の残りの行に追加する必要があります。

次のファイルがあります。

<LocationMatch ^/raframework>
SetHandler weblogic-handler
WeblogicCluster xlytwv02-pub.sherwin.com:45330
WLIOTimeoutSecs 6000
Idempotent OFF
</LocationMatch>

<LocationMatch ^/biplus_webservices>
SetHandler weblogic-handler
WeblogicCluster xlytwv02-pub.sherwin.com:45330
</LocationMatch>

<LocationMatch ^/hr>
SetHandler weblogic-handler
WeblogicCluster xlytwv02-pub.sherwin.com:8530
WLIOTimeoutSecs 18000
Idempotent OFF
WLSocketTimeoutSecs 18000
</LocationMatch>

次のように修正する必要があります。どんな値でも構いません。

  <LocationMatch ^/raframework>
  raframework:SetHandler weblogic-handler
  raframework:WeblogicCluster xlytwv02-pub.sherwin.com:45330
  raframework:WLIOTimeoutSecs 6000
  raframework:Idempotent OFF
  </LocationMatch>

  <LocationMatch ^/biplus_webservices>
  biplus_webservices:SetHandler weblogic-handler
  biplus_webservices:WeblogicCluster xlytwv02-pub.sherwin.com:45330
  </LocationMatch>

  <LocationMatch ^/hr>
  hr:SetHandler weblogic-handler
  hr:WeblogicCluster xlytwv02-pub.sherwin.com:8530
  hr:WLIOTimeoutSecs 18000
  hr:Idempotent OFF
  hr:WLSocketTimeoutSecs 18000
  </LocationMatch>

ベストアンサー1

awk<LocationMatch.../>値と中間行のプレフィックスを追跡するフィルタが機能するはずです。

awk '/^<LocationMatch \^/ {
  print $0
  m=substr($2,3,length($2)-3) ":"
  next
}
/^<\/LocationMatch>/ { m="" }
{ print m $0 }
'

このループにはmプレフィックス:が含まれています。私たちはそれをオンラインにして<LocationMatch>消去します</LocationMatch>。他のすべての行(空白行と前後のすべての行を含む)は、変更されていないままにしてください。

おすすめ記事