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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -