當前位置:編程學習大全網 - 電腦編程 - 用shell腳本實現兩個文件比較

用shell腳本實現兩個文件比較

[root@localhost?xly]#?ll?a.txt?b.txt?

-rw-r--r--?1?root?root?28?Jul?13?15:00?a.txt

-rw-r--r--?1?root?root?30?Jul?13?15:00?b.txt

[root@localhost?xly]#?cat?a.txt?

hello

123

this?is?a.txt

456

[root@localhost?xly]#?cat?b.txt?

hello!

123

this?is?b.txt

4567

[root@localhost?xly]#?diff?a.txt?b.txt?

1c1

<?hello

---

>?hello!

3,4c3,4

<?this?is?a.txt

<?456

---

>?this?is?b.txt

>?4567

1c1就是指2個文件第壹行不壹樣

<指的是a.txt

>指的是b.txt

  • 上一篇:CNC編程中工件坐標系G54~G59如何更換?
  • 下一篇:麗水市連都去大洋路哪裏有培訓班好壹點
  • copyright 2024編程學習大全網