FTP script not working

Hi ,

Hi ,

seems in my code '\' is ignoring in user id and considering DB_SVCGPRUAT as a ID and failing to connect to the FTP server. my complete ID 'BD\SVCGPRUAT', how to rectify this error.

#!/bin/bash

myuser='"BD\_SVCGPRUAT"   { BD is domain }
mypass='Welcome$123'
host="10.230.120.55"
ftp -nvi $host <<END_SCRIPT
Connected to 10.230.120.55 (10.230.120.55). 
220 Microsoft FTP Service 
331 Password required for BD_SVCGPRUAT. 
530 User MH_SVCGPRUAT cannot log in. 
Login failed. 
Interactive mode on. 
?Invalid command 
221  

same code is working for another FTP server but for that login credentails are without domain ID means just '_SVCGPRUAT' not BD is that making an issue?

appreciate anyone's advise.

Just a guess. Use 2 \ characters.

Just tried , but failed User BD_SVCIFMSUAT cannot log in.

myuser="BD\\_SVCIFMSUAT"

wild guess.. is it because of the $ in password ?

mypass='Welcome$123'

Issue resolved .

User id and password should be in single quote and myuser='BD\\_SVCIFMSUAT' and two charaters.

$ in password is fine.

Thread can be closed, Thanks.

1 Like