shell script fun! how to perform an action on each subdirectory from a given path??

Posted by pocketfullofcheese on Stack Overflow See other posts from Stack Overflow or by pocketfullofcheese
Published on 2010-04-30T00:48:08Z Indexed on 2010/04/30 1:07 UTC
Read the original article Hit count: 405

Filed under:
|
|
|

I am writing a shell script (which I suck at) and I need some help. Its a script that is moving things from git to CVS (not important). The thing is, i a file path:

controllers/listbuilder/setup/SubmissionRolesListbuilderHandler.inc.php

and I need to be able to do:

cvs add controllers;
cvs add controllers/listbuilder;
cvs add controllers/listbuilder/setup;
cvs add controllers/listbuilder/setup/SubmissionRolesListbuilderHandler.inc.php

Can someone help me out? The best I've come up with so far is to recursively add ALL files in my working tree, but that seems overly inefficient.

© Stack Overflow or respective owner

Related posts about shell-scripting

Related posts about dirname