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 命令设置的别名已损坏,该命令正在尝试执行涉及 和 的操作dirnamesu请修复或删除已损坏的别名。

相关内容