日期:2014-05-16  浏览次数:20756 次

sed命令如何实现XML文件的增删改??急急急!哪位大神告诉下啊
<DC_Public>
    < Codec_Space Codec_SpaceValue="0" />
    < HeartBeatCfg HeartBeatRate="16" Mux_HB_DECount="2" Codec_HB_DECount="2" Prov_HB_DECount="2" />
    < DC_Public PathValue="dc_user.rft" DefaultUserName="administrator" DefaultUserPassword="12345678" PrivateData="PrivateData" />
    < CheckPW TheValue="1" />
    < Device_Info VideoInputNum="10" AudioInputNum="1" VideoOutputNum="4" AudioOutputNum="1" />
    < StreamTransport ConnectTimes="0" />
</DC_Public>
<DC_NetWork>
    < Codec_SockControl Codec_IP="192.168.240.240" Codec_CtrPort="3300" Codec_UDPHeartPort="27229" Codec_LogPort="27235" Link_Internal_Codec="eth2" />
    < Mux_SockControl Mux_LogPort="27235" Mux_CtrPort="5000" Mux_IP="192.168.230.230" />
    < LinkCfg Link_Internal_Mux="eth1" Link_OutSide="eth3" Link_Internal_Codec="eth2" />
    < ControlListen ListenPort="2000" />
</DC_NetWork>
<DC_SerialProt>
    < Port1 PortUsage="3" PortEnable="1" PortDevAddr="/dev/ttyS0" PortBaudrate="9" PortByteSize="4" PortParity="0" PortStopBit="1" FlowControl="0" />
    < Port2 PortUsage="2" PortEnable="1" PortDevAddr="/dev/ttyS1" PortBaudrate="9" PortByteSize="4" PortParity="0" PortStopBit="1" FlowControl="0" />
    < Port3 PortUsage="4" PortEnable="1" PortDevAddr="/dev/ttyS2" PortBaudrate="9" PortByteSize="4" PortParity="0" PortStopBit="1" FlowControl="0" />
    < Port4 PortUsage="5" PortEnable="1" PortDevAddr="/dev/ttyS3" PortBaudrate="9" PortByteSize="4" PortParity="0" PortStopBit="1" FlowControl="0" />
    < Port5 PortUsage="7" PortEnable="1" PortDevAddr="/dev/ttyS4" PortBaudrate="13" PortByteSize="4" PortParity="0" PortStopBit="1" FlowControl="0" />
    < Port6 PortUsage="1" PortEnable="1" PortDevAddr="/dev/ttyS5" PortBaudrate="9" PortByteSize="4" PortParity="0" PortStopBit="1" FlowControl="0" />
</DC_SerialProt>
<OSDManageMoudle>
    < OSDBaseInfo InputOSDCount="10" />
    < InputOSD_ID1 OSD_Script="Input1" InputVSID="1" FontSize="10" FontSpace="0" Position="1" RedColor="255" GreenColor="255" BlueColor="255" Enable="0" />
    < InputOSD_ID2 OSD_Script="Input2" InputVSID="2" FontSize="10" FontSpace="0" Position="1" RedColor="255" GreenColor="255" BlueColor="255" Enable="0" />
    < InputOSD_ID3 OSD_Script="Input3" InputVSID="3" FontSize="10" FontSpace="0" Position="1" RedColor="255" GreenColor="255" BlueColor="255" Enable="0" />
    < InputOSD_ID4 OSD_Script="Input4" InputVSID="4" FontSize="10" FontSpace="0" Position="1" RedColor="255" GreenColor="255" BlueC