I need a list of all file types of text files in CVS (such as .cpp,.h etc. )
can it be done?
From stackoverflow
Oded
-
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 | uniqExplanation:
- 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
Scoregraphic : You're assuming he's using Linuxdanieli : Yeah, or any decent *NIX OS (Solaris, BSD, etc.)Oded : I'm using Windows :-)William Pursell : @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 -uFrom danieli
0 comments:
Post a Comment