gpt4 book ai didi

linux - diff -y 奇怪的输出

转载 作者:太空宇宙 更新时间:2023-11-04 05:11:32 25 4
gpt4 key购买 nike

我有两个文件,如下:文件1.txt

0000075d-7f2c-4896-83b4-5738d23bc4ba
000066c6-1184-47fc-acf6-916cb640c3f4
0000913e-adf2-41be-b377-749bd656cbf5
0000cb55-9b2c-42ea-af3e-87d2c7713c13
00012ac0-a893-41c7-a806-27728a1127e2
00013bea-4be2-4270-8efe-c00cd57b525d
00014c1d-6a5d-4c5e-aff0-a44cf49c54d5
0001d18b-c5c8-41c4-bcb0-e3c8074cb39e
00022848-b122-4c6a-b810-51737db09a5b
00022b1e-0148-4dad-bb82-a9be457ed2e7

文件2.txt

0000075d-7f2c-4896-83b4-5738d23bc4ba
0000116d-4255-427c-9319-a60170770d40
000032d2-3795-4b38-a222-b6599061b467
00004090-fbf1-4fd5-80cc-1f34d45af7a1
0000456e-1070-46c0-83e4-6fff495b89a3
00005b49-5266-405e-b4d3-d9a441bc38e3
000066c6-1184-47fc-acf6-916cb640c3f4
000099a6-d457-47fb-a274-63eb566bfd44
00012ac0-a893-41c7-a806-27728a1127e2
00013bea-4be2-4270-8efe-c00cd57b525d

当我运行时

diff -y file1.txt file2.txt

我得到以下奇怪的输出:

0000075d-7f2c-4896-83b4-5738d23bc4ba                            0000075d-7f2c-4896-83b4-5738d23bc4ba
> 0000116d-4255-427c-9319-a60170770d40
> 000032d2-3795-4b38-a222-b6599061b467
> 00004090-fbf1-4fd5-80cc-1f34d45af7a1
> 0000456e-1070-46c0-83e4-6fff495b89a3
> 00005b49-5266-405e-b4d3-d9a441bc38e3
000066c6-1184-47fc-acf6-916cb640c3f4 000066c6-1184-47fc-acf6-916cb640c3f4
0000913e-adf2-41be-b377-749bd656cbf5 | 000099a6-d457-47fb-a274-63eb566bfd44
0000cb55-9b2c-42ea-af3e-87d2c7713c13 <
00012ac0-a893-41c7-a806-27728a1127e2 00012ac0-a893-41c7-a806-27728a1127e2
00013bea-4be2-4270-8efe-c00cd57b525d 00013bea-4be2-4270-8efe-c00cd57b525d
00014c1d-6a5d-4c5e-aff0-a44cf49c54d5 <
0001d18b-c5c8-41c4-bcb0-e3c8074cb39e <
00022848-b122-4c6a-b810-51737db09a5b <
00022b1e-0148-4dad-bb82-a9be457ed2e7 <

这个输出看起来很奇怪:

0000913e-adf2-41be-b377-749bd656cbf5                          | 000099a6-d457-47fb-a274-63eb566bfd44

我不确定这个输出在这里意味着什么,因为它们是不同的,但它们在同一行,带有“|”在中间。

如果有人知道原因,请告诉我。

非常感谢。

最佳答案

看看documentation for GNU diffutils ,它提供了并排使用的标记的描述以及以下示例输出:

The Way that can be told of is n   <
The name that can be named is no <
The Nameless is the origin of He The Nameless is the origin of He
The Named is the mother of all t | The named is the mother of all t
>
Therefore let there always be no Therefore let there always be no
so we may see their subtlety, so we may see their subtlety,
And let there always be being, And let there always be being,
so we may see their outcome. so we may see their outcome.
The two are the same, The two are the same,
But after they are produced, But after they are produced,
they have different names. they have different names.
> They both may be called deep and
> Deeper and more profound,
> The door of all subtleties!

| 标记基本上表明该行存在于两个文件中,但已被修改。

在您的示例中,比较算法认为该行上的两个文件之间的内容足够相似,它们代表同一行,但进行了修改。

关于linux - diff -y 奇怪的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54771753/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com