linux curlftpfs,带符号的密码

时间:2012-01-22 08:22:48

标签: linux ftp curlftpfs

我想安装FTP驱动器,但我的FTP密码包含“?!”。

我输入命令:

curlftpfs myaccount:mypassword?!@thefptserver.com 

但它给了我“bash:!@ theftpsever.com:event not found”

如何逃避这些角色?

3 个答案:

答案 0 :(得分:7)

用单引号括起来:

curlftpfs 'myaccount:mypassword?!@thefptserver.com'

正如您所发现的,感叹号在bash中具有特殊含义:!@thefptserver.com代表以@thefptserver.com开头的最新命令。

答案 1 :(得分:1)

Bash正在寻找历史记录中以@theftpsever.com开头的最新命令。这称为"History expansion"可以非常有用。在这种情况下,当然不是。

您可以使用反斜杠转义!,但更常见的是使用单引号来阻止shell尝试执行此操作:

curlftpfs 'myaccount:mypassword?!@thefptserver.com'

答案 2 :(得分:0)

您可以使用以下用户选项将用户名和密码与FTP URL / IP分开:

curlftpfs -o user='myaccount:mypassword?!' thefptserver.com

我在curlftpfs手册中找到了此选项,希望对您有所帮助!

也在此链接https://superuser.com/questions/269006/curlftpfs-doesnt-work-for-a-username-with-a

中找到了相同的答案