我试图在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/''但似乎找不到神奇的组合。
发布于 2019-04-09 12:12:38
这些备选办法应有效:
-c 'mkdir "folder to create with spaces"'-c "mkdir \"folder to create with spaces\""https://unix.stackexchange.com/questions/511442
复制相似问题