regex - parsing string in bash -


i have bunch of c++ files in directory called src. needed find files have *test.cc, without .cc file type, [filename]test. have:

  1 files=./src/*test.cc   2    3 f in $files   4       5         echo "processing $f"   6 done 

so need name of file, without ./src/ , without .cc. example, above script produce:

processing ./src/utiltest.cc 

and need utiltest. how can accomplish that?

inserting line between lines 4 , 5 cause bash snippet produce desired output:

f=$(basename $f .cc) 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -