开发者

Testing all files in a directory with a program

开发者 https://www.devze.com 2023-04-01 21:01 出处:网络
I have a parser myParser which can read a file using < e.g. if I am to parse a file a.txt, I simply type

I have a parser myParser which can read a file using < e.g. if I am to parse a file a.txt, I simply type

$ myParser < a.txt

I have many such files in a directory which itself contain many other directories. For example

dir1
|- dir12
|   |- a.txt
|   |- b.txt
|- dir2
|   |- dir21
|   |    |-dir31
|  开发者_StackOverflow |    |    |-c.txt

I want to run a single command which can parse all these *.txt file for me.

Any suggestion while I play around with {find -exec}.

UPDATE : doing $ find ./ iname "*.txt" -exec ./Bin/myParser {} \;gives ./Bin/myParser permission denied.


find  <root_dir_name> -name *.txt | xargs myParser 
0

精彩评论

暂无评论...
验证码 换一张
取 消