文件路径导致的 diff 输出过长。我想通过 diff 内置的参数/选项来去除路径,以便更易读,而不需要使用 shell 脚本。
$ diff -u /share/a/b/c/d /share/1/2/3/4/ <== path is too long
diff -u /share/a/b/c/d/dirsave /share/1/2/3/4/dirsave
--- /share/a/b/c/d/dirsave 2017-08-11 16:21:50.100547799 +0800
+++ /share/1/2/3/4/dirsave 2017-08-11 16:22:21.612546684 +0800
@@ -1,2 +1,3 @@
pushd /share/qca6174/qca6174a-5-pci/QCA6174A-5-PCI/fixce/AIO/rootfs-ra-r105.build/lib/firmware
pushd /share/qca6174/qca6174a-5-pci/QCA6174A-5-PCI
+libc
然而,这条路径对我来说太长了。 我希望能够获得一个简短的路径,就像这样:
diff -u dirsave dirsave <== enhance shortly path
--- dirsave 2017-08-11 16:21:50.100547799 +0800
+++ dirsave 2017-08-11 16:22:21.612546684 +0800
@@ -1,2 +1,3 @@
pushd /share/qca6174/qca6174a-5-pci/QCA6174A-5-PCI/fixce/AIO/rootfs-ra-r105.build/lib/firmware
pushd /share/qca6174/qca6174a-5-pci/QCA6174A-5-PCI
+libc