mam następujące pliki:Dlaczego różnice z ignorowaniem pasujących wierszy nie działają zgodnie z oczekiwaniami?
plik1.txt
###################################################
Dump stat Title information for 'ssummary' view
###################################################
Tab=> 'Instance' Title=> {text {Total instances: 7831}}
Tab=> 'Device' Title=> {text {Total spice devices: 256}}
Tab=> 'Memory' Title=> {text {Total memory allocated: 962192 kB}}
Tab=> 'Cpu' Title=> {text {Total cumulative CPU time: 9030 ms}}
file2.txt
###################################################
Dump stat Title information for 'ssummary' view
###################################################
Tab=> 'Instance' Title=> {text {Total instances: 7831}}
Tab=> 'Device' Title=> {text {Total spice devices: 256}}
Tab=> 'Memory' Title=> {text {Total memory allocated: 9621932 kB}}
Tab=> 'Cpu' Title=> {text {Total cumulative CPU time: 90303 ms}}
I biegnę następujące polecenie:
diff -I 'Memory' file1.txt file2.txt
który wyprowadza :
6,7c6,7
< Tab=> 'Memory' Title=> {text {Total memory allocated: 962192 kB}}
< Tab=> 'Cpu' Title=> {text {Total cumulative CPU time: 9030 ms}}
---
> Tab=> 'Memory' Title=> {text {Total memory allocated: 9621932 kB}}
> Tab=> 'Cpu' Title=> {text {Total cumulative CPU time: 90303 ms}}
Jednak mój oczekiwana produkcja jest:
< Tab=> 'Cpu' Title=> {text {Total cumulative CPU time: 9030 ms}}
---
> Tab=> 'Cpu' Title=> {text {Total cumulative CPU time: 90303 ms}}
Należy zauważyć, że w poleceniu jeśli zmienię „Memory” do „Tab” lub rozwiązać „Tytuł” problemem, ale prawdopodobnie wszystkie linie są ignorowane przyczyna wszyscy mają Tabulator i tytuł.
Jakie są twoje oczekiwane wyniki? – fedorqui