Bash MacOS Sierra - 格式diff命令输出

时间:2017-06-13 16:53:41

标签: bash awk sed diff

我需要在macOS Sierra上的bash中格式化diff命令的输出。我将输出放在一行中,我需要在每行前面添加/删除的单独行中获得每个差异。 E.g。

  

uses-feature:name ='hardware.camera'use-feature:name ='hardware.low.camera'< > uses-implied-feature:name ='hardware.faketouch' reason ='默认功能适用于所有应用的使用 - 隐含功能:name ='hardware.touchscreen'reason ='所有应用的默认功能'<

所以我需要将其格式化为:

Deleted uses-feature: name='hardware.camera' 
Added uses-feature: name='hardware.low.camera' 
Deleted uses-implied-feature: name='hardware.faketouch' reason='default feature for all apps' 
Added uses-implied-feature: name='hardware.touchscreen' reason='default feature for all apps'

0 个答案:

没有答案