我想将 git pull 命令存储到 output.log 文件中,我想获取唯一的文件而不是文件夹名称的完整路径起始行。
实际产量
Updating ca4e3bd..82ac123
Fast-forward
build.yaml | 121 ++++------------------------------------------------------
packages/POC1/ns/POC1/testFlow2/flow.xml | 4 ++
packages/POC1/ns/POC1/testFlow2/flow.xml.bak | 4 ++
packages/POC1/ns/POC1/testFlow2/node.ndf | 42 ++++++++++++++++++++
packages/POC2/ns/POC2/testFlow1/flow.xml | 4 ++
packages/POC2/ns/POC2/testFlow1/flow.xml.bak | 4 ++
packages/POC2/ns/POC2/testFlow1/node.ndf | 42 ++++++++++++++++++++
packages/POC2/poc2.txt | 0
8 files changed, 107 insertions(+), 114 deletions(-)
create mode 100644 packages/POC1/ns/POC1/testFlow2/flow.xml
create mode 100644 packages/POC1/ns/POC1/testFlow2/flow.xml.bak
create mode 100644 packages/POC1/ns/POC1/testFlow2/node.ndf
create mode 100644 packages/POC2/ns/POC2/testFlow1/flow.xml
create mode 100644 packages/POC2/ns/POC2/testFlow1/flow.xml.bak
create mode 100644 packages/POC2/ns/POC2/testFlow1/node.ndf
create mode 100644 packages/POC2/poc2.tx
我的命令
awk -F/ '{ print $4 }' out.log1
POC1
POC1
POC1
POC2
POC2
POC2
POC1
POC1
POC1
POC2
POC2
POC2
预期输出我想喜欢这个
POC1
POC1
POC1
POC2
POC2
POC2
awk -F / 'NF >= 4 {print $4}' out.log1
POC1
POC1
POC1
POC2
POC2
POC2
POC1
POC1
POC1
POC2
POC2
POC2