SMBFS/CIFS - 無法導航到帶有空格的路徑

SMBFS/CIFS - 無法導航到帶有空格的路徑

使用 Ubuntu Server 10.04 LTS,我最近透過 apt-get 升級到最新的 samba 和 smbfs,當我透過 SMB 掛載 Windows 共享時,我收到此類錯誤:

root@orbital testsmb/test# mkdir "spaces test"

root@orbital testsmb/test# ll
total 5
drwxr-xr-x  3 nobody nobody    0 Aug  4 17:32 .
drwxr-xr-x 37 nobody nobody    0 Aug  4 17:24 ..
drwxr-xr-x  0 nobody nobody 4096 Aug  4 17:32 spaces test

root@orbital testsmb/test# cd spaces\ test/
dirname: extra operand `test'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

root@orbital /spaces# pwd
/home/testsmb/test/spaces test
dirname: extra operand `test'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

即使使用單引號和雙引號也不起作用:

root@orbital /spaces# cd ..
root@orbital testsmb/test# cd "spaces test"
dirname: extra operand `test'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

root@orbital /spaces# cd ..

root@orbital testsmb/test# cd 'spaces test'
dirname: extra operand `test'
Try `dirname --help' for more information.
dirname: missing operand
Try `dirname --help' for more information.
-su: [: =: unary operator expected
basename: missing operand
Try `basename --help' for more information.

這是我清理過的 /etc/fstab:

//192.168.xx.xx/winshare      /home/testsmb  smbfs   rw,credentials=/etc/samba/winshare.creds,uid=nobody,gid=nobody,auto   0       0
  • 這些都不會發生在本機檔案系統上。
  • 此外,帶有古老 smbfs 的舊 SuSE 盒子也不會遇到這些問題。

答案1

您的 cd 指令的別名設定已損壞,該指令試圖執行涉及dirname和 的操作su。修復或刪除損壞的別名。

相關內容