I have a set of directories called “CODE (GRADE)” and would like to rename them all to “CODE” creating a new empty file inside each called “GRADE.grade”.
What’s the easiest way in bash to do this?
My current idea:
find -iname "*(*)" --exec touch {}/MAGIC!.grade \;
rename 's/ \(.*$//' *(*)
If the only space in the path is in the target directory’s name, you could get away with something like this.