![`find -execdir test [command]`에 대한 명령 인용(Bash)](https://rvso.com/image/1482231/%60find%20-execdir%20test%20%5Bcommand%5D%60%EC%97%90%20%EB%8C%80%ED%95%9C%20%EB%AA%85%EB%A0%B9%20%EC%9D%B8%EC%9A%A9(Bash).png)
git fetch
원격이 있는 경우(= git remote
가 비어 있지 않은 경우) git repos에서 다음 명령을 실행하고 싶습니다 .
find -name .git -execdir test $(git remote) \; -execdir git fetch
^^^^^^^^^^^^^
How to quote/escape/mask this?
다음과 같이 작동하지 않는 많은 변형을 시도했습니다: "$(git remote)"
, '$(git remote)'
, \$\(git remote\)
, '"$(git remote)'"
, ...
답변1
이 시도:
find -name .git -execdir sh -c 'test $(git remote)' \; -execdir git fetch \;
어쨌든 쉘이 시작되기 때문에 다음을 수행할 수도 있습니다.
find -name .git -execdir sh -c 'test $(git remote) && git fetch' \;