开发者

Testing all files in a directory with a program

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜