Using FTP password beginning with a $
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Shell > Using FTP password beginning with a $




Pages (2): [1] 2 »   Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Using FTP password beginning with a $  
rsine


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 08:31 AM

I was assigned an FTP password that begins with a "$".  This seems to
be creating issues when I try to execute the following script:

ftp -nv ftp.site.com << EOF
user test $123abc
put test.txt
EOF

I can login to the site but the password is not recognized.  How do I
need to change the script to pass a password beginning with a $?

-Thanks





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
Chris F.A. Johnson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 08:31 AM

On 2004-09-24, rsine wrote:
> I was assigned an FTP password that begins with a "$".  This seems to
> be creating issues when I try to execute the following script:
>
> ftp -nv ftp.site.com << EOF
> user test $123abc
> put test.txt
> EOF
>
> I can login to the site but the password is not recognized.  How do I
> need to change the script to pass a password beginning with a $?

Put the login information in your .netrc file, or escape the dollar
sign ( \$123abc ).

--
Chris F.A. Johnson                  http://cfaj.freeshell.org/shell
 ========================================
===========================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
Arjan Groenemeijer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 08:31 AM

rsine wrote:

> I was assigned an FTP password that begins with a "$".  This seems to
> be creating issues when I try to execute the following script:
>
> ftp -nv ftp.site.com << EOF
> user test $123abc
> put test.txt
> EOF
>
> I can login to the site but the password is not recognized.  How do I
> need to change the script to pass a password beginning with a $?
>
> -Thanks

Escape the $ with a backslash:

ftp -nv ftp.site.com << EOF
user test \$123abc
put test.txt
EOF


Arjan Groenemeijer
--
TIP: www.linuxlinks.com
Slackware (10) Current - Slackware User Since '96.
mail $(echo qnqiqmqdqrqaquqgq@qmqyqrqeqaqlqbqoqxq.qcqoqmq | sed 's/q//g')





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
Lew Pitcher


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 08:31 AM

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

rsine wrote:
> I was assigned an FTP password that begins with a "$".  This seems to
> be creating issues when I try to execute the following script:
>
> ftp -nv ftp.site.com << EOF
> user test $123abc
> put test.txt
> EOF
>
> I can login to the site but the password is not recognized.  How do I
> need to change the script to pass a password beginning with a $?
>
> -Thanks

PASSWD='$123abc'
ftp -nv ftp.site.com << EOF
user test $PASSWD
put test.txt
EOF

- --

Lew Pitcher, IT Consultant, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

 iD8DBQFBVGkJagVFX4UWr64RAu9CAJ94hQmbz9kO
bI2IHpihgsGfZ4lAagCguo9B
7spmZCGNsfaF+uTuXcOndaU=
=WnKR
-----END PGP SIGNATURE-----





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
Alan Connor


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 08:31 AM

On 24 Sep 2004 11:26:52 -0700, rsine <rsine@stationeryhouse.com>
wrote:


> I was assigned an FTP password that begins with a "$". This
> seems to be creating issues when I try to execute the following
> script:
>
> ftp -nv ftp.site.com << EOF user test $123abc put test.txt EOF
>
> I can login to the site but the password is not recognized.
> How do I need to change the script to pass a password beginning
> with a $?
>
> -Thanks

Try putting it in quotes or escaping it like so \$.


AC





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
Stachu 'Dozzie' K.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 08:31 AM

On 2004-09-24, rsine wrote:
> I was assigned an FTP password that begins with a "$".  This seems to
> be creating issues when I try to execute the following script:
>
> ftp -nv ftp.site.com << EOF
> user test $123abc
> put test.txt
> EOF
>
> I can login to the site but the password is not recognized.  How do I
> need to change the script to pass a password beginning with a $?

If you use bash or zsh you can try something like that:
#v+
ftp -nv ftplsite.com << 'EOF'
user test $123abc
put test.txt
EOF
#v-

I don't know if it works with other shells.

--
Stanislaw Klekot





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 08:31 AM

In article <cj1qsk$c0f$1@news.dialog.net.pl>,
"Stachu 'Dozzie' K." <cut-to-last-hypen-dozzie@dynamit.im.pwr.wroc.pl>
wrote:

> On 2004-09-24, rsine wrote: 
>
> If you use bash or zsh you can try something like that:
> #v+
> ftp -nv ftplsite.com << 'EOF'
> user test $123abc
> put test.txt
> EOF
> #v-
>
> I don't know if it works with other shells.

The rule that quoting the end marker prevents variable expansion in the
here-document was in Bourne shell, so it should work with pretty much
any shell.  It even works in C shell, although it requires you to
include the quotes around the marker in the here-document as well:

cat <<'EOF'
$123abc
'EOF'

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
Chris F.A. Johnson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 08:32 AM

On 2004-09-24, rsine wrote:
> I was assigned an FTP password that begins with a "$".  This seems to
> be creating issues when I try to execute the following script:
>
> ftp -nv ftp.site.com << EOF
> user test $123abc
> put test.txt
> EOF
>
> I can login to the site but the password is not recognized.  How do I
> need to change the script to pass a password beginning with a $?

Put the login information in your .netrc file, or escape the dollar
sign ( \$123abc ).

--
Chris F.A. Johnson                  http://cfaj.freeshell.org/shell
 ========================================
===========================
My code (if any) in this post is copyright 2004, Chris F.A. Johnson
and may be copied under the terms of the GNU General Public License





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
rsine


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 01:28 PM

Barry Margolin <barmar@alum.mit.edu> wrote in message news:<barmar-C5B0EE.20131824092004@com
cast.dca.giganews.com>...
> In article <cj1qsk$c0f$1@news.dialog.net.pl>,
>  "Stachu 'Dozzie' K." <cut-to-last-hypen-dozzie@dynamit.im.pwr.wroc.pl>
>  wrote:
> 
>
> The rule that quoting the end marker prevents variable expansion in the
> here-document was in Bourne shell, so it should work with pretty much
> any shell.  It even works in C shell, although it requires you to
> include the quotes around the marker in the here-document as well:
>
> cat <<'EOF'
> $123abc
> 'EOF'


I tried each suggestion and still am not having any success with the
password.  Here is a sample of what I get from the FTP server when
running my script:

Connected to ftp.site.com.
220 osiris Microsoft FTP Service (Version 5.0).
331 Password required for test.
530 User test cannot log in.
Login failed.
530 Please login with USER and PASS.
200 PORT command successful.
530 Please login with USER and PASS.
221

Is there anything else I can try?





[ Post a follow-up to this message ]



    Re: Using FTP password beginning with a $  
Kenny McCormack


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-28-04 01:28 PM

In article <bc91bd3a.0409280504.333fbb0c@posting.google.com>,
rsine <rsine@stationeryhouse.com> wrote:
... 

ITYM: I cannot login to the site because the password is not recognized.
[vbcol=seagreen]
>I tried each suggestion and still am not having any success with the
>password.  Here is a sample of what I get from the FTP server when
>running my script:
>
>Connected to ftp.site.com.
>220 osiris Microsoft FTP Service (Version 5.0).
>331 Password required for test.
>530 User test cannot log in.
>Login failed.
>530 Please login with USER and PASS.
>200 PORT command successful.
>530 Please login with USER and PASS.
>221
>
>Is there anything else I can try?

Well, the simple "cat test" will show if there is any kind of quoting
issue.  I assume that the following works as expected:

sh
$ cat << 'X'
user test $abc1234
X
$

Assuming that works, then the "issue" must be somewhere else.

1) Just for the record, can you login to this account manually?
(Maybe MS servers have a problem with PWs that start with $...)

2) You might want to consider a different FTP client.  I never liked the
"ftp << EOF" kinda thing much anyway.  Maybe try ncftp.






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:03 PM.      Post New Thread    Post A Reply      
Pages (2): [1] 2 »   Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register