도구도 필요 없고 구현/알고리즘도 필요해요 :) 서버에 아무것도 설치할 수 없어서 쉘스크립트를 만들어야 해요
f2.txt
She has 123 apples
George 18 years is old
Florin it's leaving
Michael it's not here
Peter is smiling
f1.txt
She has 132 apples
George is 18 years old
Michael it's not here
Peter is smiling
He is sleeping
원하는 출력:
diff is at:
line 1 : 123 instead of 132
line 2 : 18 years is instead of is 18 years
lines missing:
He is sleeping
lines added:
line 3: Florin it's leaving
답변1
요청한 형식과 정확히 일치하지는 않지만 wdiff
아마도 최선의 선택일 것입니다.
$ wdiff f1.txt f2.txt
She has [-132-] {+123+} apples
George [-is-] 18 years {+is+} old
{+Florin it's leaving+}
Michael it's not here
Peter is smiling
[-He is sleeping-]