我正在尝试在 bash 脚本中使用 smbclient 在远程 Windows 服务器上创建目录。
虽然这有效:
smbclient -U "DOMAIN/$username" "//remoteserver/folder with spaces" --directory "Another folder with spaces/" -c "mkdir /newfolder/"
这不会:
smbclient -U "DOMAIN/$username" "//remoteserver/folder with spaces" --directory "Another folder with spaces/" -c "mkdir /folder to create with spaces/"
而是创建了一个简称为“文件夹”的文件夹。我尝试了许多变体,如下所示:
"mkdir /folder\ to\ create\ with\ spaces/"
"mkdir '/folder to create with spaces/'"
'mkdir '/folder to create with spaces/''
但似乎找不到神奇的组合。