We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,503 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Grabbing all .cpp or .h files within directory of subdirectories and files

I am trying to run chekstyle on all of my files within a project. So I have model, view, and controller folders all with their subfolders of .h and .cpp files. Is there any way to grab all the files that end in .h or .cpp without having to individually specify the folders I want to check? Right now my command is something like: CppCheckStyle inc/.h src/.cpp, etc,etc...but I'd rather skip the hassle of specifying all of the folder names.

Thanks!

2
Contributors
1
Reply
2 Hours
Discussion Span
1 Year Ago
Last Updated
2
Views
freedomflyer
Light Poster
27 posts since Jan 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I think find might work in this instance.
find -name "*.h" -exec CppCheckStyle {} \; -o -name "*.cpp" -exec CppCheckStyle {} \;

chris.stout
Junior Poster in Training
54 posts since Apr 2012
Reputation Points: 14
Solved Threads: 3
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.5877 seconds using 2.65MB