I'm attempting a batch rename of camelcase-named files to include spaces between adjacent upper and lower case leters. I'm using Mac OS so the utils I'm using are the BSD-variant.
For example:
250 - ErosPhiliaAgape.mp3 => 250 - Eros Philia Agape.mp3
I'm trying to find
the relevant files and pipe them to mv
which runs sed
in a subshell, using this command:
find . -name "*[a-z][A-Z]*" -print0 | xargs -0 -I {} mv {} "$(sed -E 's/([a-z])([A-Z])/\1 \2/g')"
Individually, these commands work fine: find
pulls up the correct files and sed
renames it correctly, but when I combine them with xargs, nothing happens.
What do I need to change to make this work?