我需要将文件从“some string[blah].srt”重命名为“some.string.srt”;
我用:
mv -v "$file" "$newfile.srt"
$newfile 是带有点而不是空格的 $file。
我收到以下错误:
mv: rename dir1/Some string[blah].srt* to dir1/Some.string.srt: No such file or directory
这是变量值和目录内容:
dir content:
total 715368
-rwxr-xr-x 1 Dahan staff 43K Nov 29 2012 Some string S01E12[blah].srt*
-rw-r--r-- 1 Dahan staff 349M Mar 26 20:42 Some.string.S01E12.avi
newfilename: /Users/Dahan/dir1/Some.string.S01E12.srt
file: /Users/Dahan/dir1/Some string S01E12[blah].srt*
mv: rename /Users/Dahan/dir1/Some string S01E12[blah].srt* to /Users/Dahan/dir1/Some.string.S01E12.srt: No such file or directory
不知何故,如果我从文件中删除 [blah] 部分,它可以正常工作。
知道我做错了什么吗?