删除不同目录下同名但不同后缀的文件

#!/usr/bin/env bash

# 删除不同目录下同名但不同后缀的文件

function CompearVipDoanloadAndVIPSongs() {
    VipSongsDoanloadDir="/mnt/d/Music/VipSongsDownload";
    VIPSongsDir="/mnt/d/Music/VIPSongs"
    VIPSongsNames="$(ls $VIPSongsDir|cut -d "." -f1)"

    # 将 for 轮询的标识符从空格改成换行
    IFS=$'\n'

    for i in $(echo -e "$VIPSongsNames")
    do
      [ -f $VipSongsDoanloadDir/$i.* ] && echo -e "删除 $VipSongsDoanloadDir/$i.*\n" && rm -f $VipSongsDoanloadDir/$i.*
    done

}