I have folders named:
example1 example2 example3
And I want to extract the example number from each of them. Something like:
for exampleSubfolder in `find . -type d`
do
example_number= #replace 'example' in $exampleSubfolder with empty string
#do other stuff in this subfolder
done
Any simple way to do this?
If you only need the number:
But if you want to know the correspondance between folder name and number:
Updated with the string replace bashism.