1
awk를 cppcheck의 출력에 사용하고 싶습니다. 그러나 cppcheck가이 라이너의 끝에 awk에 출력하지 않는 것처럼 보입니다. cppcheck의 출력을 awk에 파이프로 보내서 필터 할 수있는 방법이 있습니까?cppcheck가 파이프와 잘 작동하도록하기
git status -s | awk '(($1 ~ /M/) || ($1 ~ /A/)) { print $2 }' | xargs cppcheck -j 2 --enable=warning,performance | awk '/error/ { print $1 }'
그리고 여기 내 출력
[silly.cpp:9]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'char *'.
[silly.cpp:7]: (error) Buffer is accessed out of bounds: buf