- 论坛徽章:
- 32
|
回复 4# Tennessee3Waltz
你看一下我执行的,明显是有变的:- $ cat i
- <hellokitty class="ipod" distName="MRsmile-1852/LNsmile-1852/ipod-0" operation="create" version="over">
- <p name="ipadbigAddrCtrl">[color=Red]macPro[/color]</p>
- <p name="ipadbigAddr">1.1.1.0</p>
- <p name="x2LinkStatus">unavailable</p>
- </hellokitty>
- <hellokitty class="ipod" distName="MRsmile-1852/LNsmile-1852/ipod-1" operation="create" version="over">
- <p name="ipadbigAddrCtrl">[color=Red]macPro[/color]</p>
- <p name="ipadbigAddr">1.1.1.1</p>
- <p name="x2LinkStatus">unavailable</p>
- </hellokitty>
- <hellokitty class="ipod" distName="MRsmile-1852/LNsmile-1852/ipod-2" operation="create" version="over">
- <p name="ipadbigAddrCtrl">[color=Red]macPro[/color]</p>
- <p name="ipadbigAddr">1.1.1.2</p>
- <p name="x2LinkStatus">unavailable</p>
- </hellokitty>
- <hellokitty class="ipod" distName="MRsmile-1852/LNsmile-1852/ipod-3" operation="create" version="over">
- <p name="ipadbigAddrCtrl">[color=Red]macPro[/color]</p>
- <p name="ipadbigAddr">1.1.1.3</p>
- <p name="x2LinkStatus">unavailable</p>
- </hellokitty>
- $ awk '/macPro/&&n++<10{sub(/macPro/,"macAir")}1' i
- <hellokitty class="ipod" distName="MRsmile-1852/LNsmile-1852/ipod-0" operation="create" version="over">
- <p name="ipadbigAddrCtrl">[color=Red]macAir[/color]</p>
- <p name="ipadbigAddr">1.1.1.0</p>
- <p name="x2LinkStatus">unavailable</p>
- </hellokitty>
- <hellokitty class="ipod" distName="MRsmile-1852/LNsmile-1852/ipod-1" operation="create" version="over">
- <p name="ipadbigAddrCtrl">[color=Red]macAir[/color]</p>
- <p name="ipadbigAddr">1.1.1.1</p>
- <p name="x2LinkStatus">unavailable</p>
- </hellokitty>
- <hellokitty class="ipod" distName="MRsmile-1852/LNsmile-1852/ipod-2" operation="create" version="over">
- <p name="ipadbigAddrCtrl">[color=Red]macAir[/color]</p>
- <p name="ipadbigAddr">1.1.1.2</p>
- <p name="x2LinkStatus">unavailable</p>
- </hellokitty>
- <hellokitty class="ipod" distName="MRsmile-1852/LNsmile-1852/ipod-3" operation="create" version="over">
- <p name="ipadbigAddrCtrl">[color=Red]macAir[/color]</p>
- <p name="ipadbigAddr">1.1.1.3</p>
- <p name="x2LinkStatus">unavailable</p>
- </hellokitty>
复制代码 |
|