0
我想在具有空間(File-One)的遠程文件夾的PowerShell腳本中從cygwin運行rsync並獲取以下錯誤。試圖逃脫空間,但仍然無法正常工作。在錯誤中,目錄名稱是「/ e/Files/File」,不完整,而實際的文件夾名稱應該是「/ e/Files/File - One/root /」。還嘗試了用多個反斜槓逃脫空間,但仍然是相同的錯誤。這可能是什麼問題?在cygwin中運行rsync
Write-Output $rsync-cmd
Invoke-Expression -command $rsync_cmd
命令和錯誤:
C:\cygwin64\bin\bash.exe --login -c 'rsync -tvhPrI --stats [email protected]:"/e/Files/File\ -\ One/root/" "/e/Files/File\ -\ One/root"'
receiving incremental file list
rsync: link_stat "/e/Files/File" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1637) [Receiver=3.1.1]
逃避的目標字符串解決了所有問題同樣的方法你逃脫了第一個:'「/ e/Files/File \\ - \\ One/root」' - 或者只是一個反斜槓來轉義 –
是的,我也試過了..它不起作用,有同樣的錯誤。 – user3331975
只是更新了腳本,所以它沒有混淆。 – user3331975