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
精彩评论