views:

48

answers:

1

I need a list of all file types of text files in CVS (such as .cpp,.h etc. )

can it be done?

A: 

I know it's quick and dirty but you can play with regular expressions, grepping, redirecting to a file, sorting...(blah blah blah):

cvs ls -R [path to repo] | grep "\.[A-Za-z0-9]*$" | sed 's/.*\(\.[A-Za-z0-9]*\)$/\1/' > fileExtensions && sort fileExtensions | uniq

Explanation:

  • list all files in the repository
  • print only those with an extension
  • extract the extension with sed
  • redirect output to a file
  • sort the file, then print unique lines
danieli
You're assuming he's using Linux
Scoregraphic
Yeah, or any decent *NIX OS (Solaris, BSD, etc.)
danieli
I'm using Windows :-)
Oded
@Scoregraphic: there is no assumption about Linux or *nix. The only assumption is the existence of the tools grep, sed, cvs, and uniq and the syntax for piping and redirecting output.
William Pursell
sort | uniq can be replaced with sort -u
William Pursell