我沒有成功寫入正確的代碼!
我的目錄是這樣無法重命名子目錄中的文件(有條件)[shell腳本]
/Users/dave/yellow/shade001/light
/Users/dave/yellow/shade001/dark1
/Users/dave/yellow/shade001/dark2
...
/Users/dave/yellow/shade999/light
/Users/dave/yellow/shade999/dark1
/Users/dave/yellow/shade999/dark2
有黃色目錄內的約999樹蔭文件夾,每個包含 2或3個文件(light
始終存在,dark1
總是存在的,並且有時dark2
存在)。我想重新命名light
,dark1
和刪除dark2
這樣的:
light.txt renamed to lgt.txt
dark1.txt renamed to dk1.txt
dark2 (whenever found) should be deleted
這裏是我做的:
for /r %x in (light.txt) do ren "%x" lgt.txt for /r %x in (dark1.txt) do ren "%x" dk1.txt find . -type f -name 'dark2' -delete done
而......問題是什麼?問題在哪裏? – pkalinow