linux curlftpfs, password with symbols

7.6k Views Asked by At

I want to mount an FTP drive, but my FTP password contains "?!".

I enter the command:

curlftpfs myaccount:[email protected] 

but it gives me "bash: [email protected]: event not found"

How do I escape those characters?

3

There are 3 best solutions below

0
On BEST ANSWER

Enclose it in single quotes:

curlftpfs 'myaccount:[email protected]'

As you've discovered, the exclamation mark has a special meaning in bash: [email protected] stands for the most recent command that started with @thefptserver.com.

2
On

Bash is looking for the most recent command starting with @theftpsever.com in your history. This is called "History expansion" and can be really useful. In this case, of course, it is not.

You can escape the ! using a backslash, but it's more usual to use single quotes to stop your shell trying to do this:

curlftpfs 'myaccount:[email protected]'
0
On

You can separate user and password from FTP URL/IP using user option below:

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

I found this option in curlftpfs manual and hope it helps!

Also found the same answer in this link https://superuser.com/questions/269006/curlftpfs-doesnt-work-for-a-username-with-a