How do I apply a shell command to many files in nested (and poorly escaped) subdirectories?

后端 未结 6 1616
别跟我提以往
别跟我提以往 2020-12-06 03:31

I\'m trying to do something like the following:

for file in `find . *.foo`
do
somecommand $file
done

But the command isn\'t working because

6条回答
  •  遥遥无期
    2020-12-06 03:54

    find . -name '*.foo' -print0 | xargs -0 sh -c 'for F in "${@}"; do ...; done' "${0}"
    

提交回复
热议问题