Re: Need to put backslash into a username in an FTP script

From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 04/28/05


Date: Thu, 28 Apr 2005 18:30:13 GMT

On comp.unix.shell, in
<1114707665.828981.193950@g14g2000cwa.googlegroups.com>,
"billadams1@gmail.com" wrote:

Okay. Since no one else has come up with a solution here,
I'll just rattle off some thoughts on the subject.

> I'm FTPing a file in a script to a Microsoft server which is
> requiring me to use the domain-name with a backslash then the
> username. For example:
>

> ftp -i -n <<- EOF
> open servername
> user domain\username password
> mput filename
> close
> quit
> EOF
>

> The Unix side doesn't like the backslash. It says "User
> domainusername cannot login", so I used another backslash as an
> indicator:
>
> user domain\\username password
>
> No dice. So I tried single quotes:
>
>
> user 'domain\username' password

I'd quote the entire right side.

>
> Nada! Please help.
>
>
> Thanks, -ba
>

If you are getting past the unix side with the quotes,
maybe it's the usual M$ requirement for CRLF line
terminations that's the problem.

You might try adding the CRs with ^V^M in vi.

Or use a more sophisticated and modern ftp client, like
ncftp, which is excellent and comes with utilities to
facilitate the use of scripts. It's free.

http://www.ncftp.com

HTH,

AC

-- 
alanconnor AT earthlink DOT net
Use your real return address or I'll never know you
even tried to mail me. http://tinyurl.com/2t5kp


Relevant Pages

  • Need to put backslash into a username in an FTP script
    ... I'm FTPing a file in a script to a Microsoft server which is requiring ... me to use the domain-name with a backslash then the username. ... The Unix side doesn't like the backslash. ...
    (comp.unix.shell)
  • Re: regex help
    ... I have a few regexs I need to do, but im struggling to come up with a ... The obvious problems here are the spurious double quotes, ... backslash and open parenthesis. ... literals when you're dealing with regular expressions, ...
    (comp.lang.python)
  • Re: Stop ignoring \ double backslash under ksh
    ... > script. ... Unfortunately the double backslash gets stripped to a single ... > shell but the wisdom of cusm readers will be grately appreciated. ... Simple way, use escape quotes: ...
    (comp.unix.sco.misc)
  • Stop ignoring \ double backslash under ksh
    ... (without the double quotes) ... script. ... Unfortunately the double backslash gets stripped to a single ... shell but the wisdom of cusm readers will be grately appreciated. ...
    (comp.unix.sco.misc)
  • Re: Bash Parameter Expansion
    ... echo '$HOME'>file ... Is there any way to ensure that the parameter expansion does occur by ... Enclosing characters in single quotes preserves the literal value of each ... even when preceded by a backslash. ...
    (uk.comp.os.linux)