Example of usage (contrived!): rename .mp3 files to .txt.
I'd like to be able to do something like
find -name '*.mp3' -print0 | xargs -0 -I'file' mv file ${file%.mp3}.txt
This doesn't work, so I've resorted to piping find
's output through sed -e 's/.mp3//g'
, which does the trick.
Seems a bit hackish though; is there a way to use the usual bash ${x%y}
syntax?