문제

find . -name '.git' -exec printf %q "'{}'"  \; ;
printf: illegal format character q

It seems the problem is that the printf being called is not bashes builtin printf Is there any way to use builtin printf ?

도움이 되었습니까?

해결책

Just call bash and give it an inline script to invoke printf:

 find . -name '*.txt' -exec bash -c "printf %q\\\\n {}" \;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top