在挂载命令中转义特殊字符 [英] Escape special characters in mount command

查看:199
本文介绍了在挂载命令中转义特殊字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Mac OSX Mavericks上安装Windows共享文件夹.简单的用户名和密码可以正常工作

I am trying to mount a windows shared folder on Mac OSX Mavericks. A simplistic user name and password worked fine

mount -t smbfs //user2:password2@server1.mydomain.com/myproject ~/localmap

尝试使用更有效的用户名和密码时,出现解析URL失败的错误. 详细是 用户名:mydomain \ user1 密码:A%b $ c @ d!e#f

On trying out the more valid user name and password I am getting errors that parsing URL failed. The details are Username: mydomain\user1 Password: A%b$c@d!e#f

尝试的命令是

mount -t smbfs //mydomain\user1:A%b\$c\@d\!e#f@server1.mydomain.com/myproject ~/localmap

基于我发现的$和!需要逃脱.在如何转义特殊字符方面需要帮助.顺便说一句,在第一种情况下,仅使用不带域的用户名似乎可行

Based on what I found, $ and ! needs to be escaped. Need help on how to escape the special characters. Incidentally, using only the username without the domain seems to work in the first case

推荐答案

只需对您的特殊字符进行编码.

Just encode your special characters.

@ -> %40
$ -> %24
! -> %21 

其他字符可以在这里找到: http://www.degraeve.com/reference/urlencoding.php

Others characters can be found here: http://www.degraeve.com/reference/urlencoding.php

例如

username="someone", password="passw@rd"

那么这应该对您有用:

mount -t smbfs //someone:passw%40rd@server/path /Volumes/path

这篇关于在挂载命令中转义特殊字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆