我需要添加前綴C_,然後將文件從tmp位置移動到目標位置。 以下是腳本 我不允許在當前目錄中放置腳本。無法重命名並將文件從一個位置移動到另一個位置
for tmpfile in /home/asmita/tmp
do
mv "$tmpfile" "C_${tmpfile}"
mv "C_${tmpfile}" /home/tgasmita
done
當我嘗試移動前綴文件時,我收到錯誤C_/home/asmita/tmp/xyz.txt找不到。因爲整個路徑存儲在tmpfile變量中。
檢查目標文件夾的權限 –