Trying to rename a series of files on a linux server. Finding the files I want is easy:
find . -type f -wholename \*.mbox
Of course, being mbox files, some of them have spaces in the names, so it becomes:
find . -type f -wholename \*.mbox -print0
I'm piping to xargs so that I can rename the files:
find . -type f -wholename \*.mbox -print0 | xargs -0 -I{} echo ${"{}"/.mbox/}
The echo should return something like INBOX, given INBOX.mbox, however, bash complains:
bash: ${"{}"/.mbox/}: bad substitution
How can I fix this? I'd like to try to keep it in a find/xargs solution if possible, so that I'm not adding a lot of looping constructs around it.