git diff
diff --git a/lids b/lids
index 1191247..2b2f2e1 100644
--- a/lids
+++ b/lids
@@ -1,2 +1,2 @@
1
-2
+3
git diffdiff --git a/lids b/lids
index 1191247..2b2f2e1 100644
--- a/lids
+++ b/lids
@@ -1,2 +1,2 @@
1
~
-2
+3
~
我只需要-2和+3 如何使用grep或shell脚本?
答案 0 :(得分:1)
将输出传输到
grep '^[+-][0-9]'
所以:
diff --git a/lids b/lids | grep '^[+-][0-9]'