简体   繁体   English

我可以在CVS中获取存储库中文本文件的所有文件扩展名吗?

[英]Can I get all the file extensions of text files in the repository in CVS?

I need a list of all file types of text files in CVS (such as .cpp, .h etc. ) 我需要CVS中文本文件的所有文件类型的列表(例如.cpp, .h等)

can it be done? 能做到吗

I know it's quick and dirty but you can play with regular expressions, grepping, redirecting to a file, sorting...(blah blah blah): 我知道它既快速又肮脏,但您可以使用正则表达式,grepping,重定向到文件,排序...(等等):

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 用sed提取扩展名
  • redirect output to a file 将输出重定向到文件
  • sort the file, then print unique lines 排序文件,然后打印唯一的行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM