I have a list of files in my directory:
opencv_calib3d.so2410.so opencv_contrib.so2410.so opencv_core.so2410.so opencv_features2d.so2410.so opencv_flann.so24
a='opencv_calib3d.so2410.so' echo "${a%%.so*}${a#*.so}" opencv_calib3d2410.so
Where:
${a%%.so*}
.so
${a#*.so}
Try this in your mv command:
mv
mv "$f" "${f/.so/}"
First match of .so is being replaced by empty string.