[Discuss] Command line question

David Bronaugh dbronaugh at linuxboxen.org
Wed Jul 26 21:48:43 PDT 2006


Adam Parkin wrote:
> Clarke Brunsdon wrote:
>> I hope all these messages aren't just because someone doesn't know about
>> 'cvs export'.
>
> Okay since you all helped so much with the first question, how about 
> another (since as it turns out I'm going to be repeating the process 
> again on Friday):
>
> In actuality what I had was a CVS repository with one module for each 
> user (this was for the course I'm TAing).  What I needed to do was get 
> a copy of each students assignment from the repository, but nothing 
> else (no CVS stuff, no files from the labs or other assignments etc).  
> Most students used the directory "a3" inside their module (since this 
> was for the 3rd assignment), but a few of course used "asn3", 
> "assign3", "assignment3", etc.  So I ended up checking out each one's 
> assignment 3 folder individually (there's only about 30 students, so 
> not a big deal), and if it was named something other than a3, I 
> renamed it to a3.  And of course some students submitted nothing at 
> all, so there was nothing to copy over.
>
> My question: is there an easy way to just grab all the students files 
> from the repository.  Thinking in terms of pseudocode I'd like to have 
> something that works like:
>
> for each student in repository
>     if a3 folder exists in students module
>         copy/export a3 contents only to current directory
>     else
>         could not find assignment 3 so add to list
>         of ones to check out manually
>
> Any suggestions?
find <directory> -type d -maxdepth 2

Not a bad start right there. Then trim out the directories that are not 
of depth 2 using egrep.

David


More information about the Discuss mailing list