You could do something like this:
for beg in *beg*mp3; do
new=${beg/beg/whole} # replace the string "beg" with the string "whole"
end=${beg/beg/end} # replace the string "beg" with the string "end"
echo sox "$beg" "$end" "$new" # show user what sort of command we plan to run
done
Save that in a file called "go", then type:
chmod +x go
./go
It will show you what it is planning to do without doing anything. If you like what it is planning to do, remove the word "echo" in the second last line and do it again. Maybe back up your files first!