Using Ubuntu Server 10.04 LTS, I recently upgraded to the latest samba and smbfs via apt-get, and when I mount our windows share via SMB, I'm getting this kind of error:
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.
Even using quotes, single and double, don't work:
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.
Here is my sanitized /etc/fstab:
//192.168.xx.xx/winshare /home/testsmb smbfs rw,credentials=/etc/samba/winshare.creds,uid=nobody,gid=nobody,auto 0 0
- None of this happens on local file systems.
- Also an older SuSE box with an ancient smbfs doesn't run into these problems.
You have a broken alias setup for the cd command that is trying to do something involving
dirname
andsu
. Fix or remove the broken alias.