How can I run this on linux command line when my username has an @
sign in the middle?
ftp -u user:password@host/destination_folder/ sourcefile.txt
My username is info@domain.com
and it thinks my host is domain.com
.
NOTE: This is an unattended upload, so I can't just type in the username and password.
I've never seen the
-u
parameter. But if you want to use an "@", how about stating it as "\@"?That way it should be interpreted as you intend. You know something like
curl -f -s --disable-epsv -u someone@somewhere.com:gr8p455w0rd -T /some/dir/filename ftp://somewher.com/ByramHealthcareCenters/byram06-2011.csv
A more complete answer would be it is not possible with ftp(at least the ftp program installed on centos 6).
Since you wanted an un-attended process, "pts"'s answer will work fine.
%40 doesn't appear to work.
All I've got is to open the ftp program and use the domain and enter the user when asked. Usually, a password is required anyway, so the interactive nature probably isn't problematic.
Try this: use "%40" in place of the "@"
I simply type
ftp hostdomain.com
and the very next prompt asked me to enter a name, if it wasn't the same as my current user.I guess it depends on how your FTP is configured. That is, whether it assumes the same username (if not provided) or asks. the good news is that even without a solution, next time you face this it might Just Work™ for you :D
Try to define the account in a
~/.netrc
file like this:Check
man netrc
for details.