之前在写的 linux 程序会调 bash + find 命令批量改文件的后辍名
find /path2myDir/predict/labels -name \"*.txt\" -exec sh -c 'mv \"$0\" \"${0%.txt}.predict\"' {} \\; 改为 windows 版本后, bash -c "command" 换成了 wsl bash -c "command..."
其他的命令都执行很正常,但这条重命令的命令一直失败,于是加了-x 把 wsl 执行的命令打印出来
"+ find /path2myDir/predict/labels -name '*.txt' -exec sh -c 'mv \"/bin/bash\" \"/bin/bash.predict\"' '{}' ';' 不知道为什么$0变成/bin/bash\ , 我尝过把$0 改为 1 也没有用
折腾了很久,最后在 wsl 里安装了 rename , 用 rename 指改了
