bash: find -exec and filenames

前端 未结 1 402
南旧
南旧 2020-12-20 18:38

I want to strip the HTML out of few hundred files.

Here\'s the command I\'ve started with:

find -name *.html -exec w3m {} > w3m {}.html.out \\; 
         


        
相关标签:
1条回答
  • 2020-12-20 19:09

    The redirection happens outside of find. Invoke a subshell.

    find -name *.html -exec bash -c 'w3m "$1" > w3m-"$1".html.out' w3mout {} \; 
    
    0 讨论(0)
提交回复
热议问题