FTP automation with special characters in userid


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP automation with special characters in userid
# 1  
Old 07-05-2010
FTP automation with special characters in userid

Hi,
i am trying to automate an ftp script which is as below.But my user id has special characters(aaa\$ifg). So it is not working correctly.Can anyone help on this?I tried providing both of them in double & singe quoted. But somehow it is not picking the "\". Also tried keeping \ before the uid(aaa\\$ifg) and (aaa\\\$ifg).But no luck.

Code:
ftp -i -n ddd << end-of-session
binary
user aaa\$ifg password
put xyz.txt
bye
end-of-session


Last edited by pludi; 07-05-2010 at 12:03 PM.. Reason: code tags, please...
# 2  
Old 07-05-2010
Have you tried using a .netrc file.
Format:
Code:
machine 192.168.1.1 login aaa\$ifg password abc123

Note that if you enter machine name as an ip address, you must use the ip address in the ftp command, and if you enter a domain name as the machine name, you must use the domain name in the ftp command.
Permissions should be 0400 or less, and located in your home directory.

Last edited by Scott; 07-05-2010 at 03:27 PM..
# 3  
Old 07-05-2010
Thank you jgt. That worked.But can't we do that using the script way of uid and password?

Thanks,
# 4  
Old 07-05-2010
jgt's solution is brilliant and the preferred solution.
Untested but deducing from jgt's work using three backslash characters before the dollar sign may be what you need but the .netrc method is still the best.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script Entry to block 9 characters userid

Hi Guys, I have one script which is used to add new user in the system. This is how we add new user in system:- sudo /opt/local/bin/new-user 114 ranivarm "Rani Varma(Libo Technical User)" INC00001111 Where 114:-is the site id ranivarm:- is userid "Rani Varma(Libo Technical User)" :-... (11 Replies)
Discussion started by: manalisharmabe
11 Replies

2. UNIX for Dummies Questions & Answers

Having a hell of atime with KSH -ftp automation

Following this thread: https://www.unix.com/ip-networking/1935-automated-ftp-task.html I have created the following script: #! /bin/ksh HOST=ftp.mywebsite2.com USER=astrocloud PASSWD=8**** exec 4>&1 ftp -nv >&4 2>&4 |& print -p open $HOST print -p user $USER $PASSWD print -p cd... (3 Replies)
Discussion started by: Astrocloud
3 Replies

3. Shell Programming and Scripting

Windows to UNIX FTP Special characters!

I have a file that has the name in one of the lines as MARíA MENDOZA in Windows. When this gets FTPed over to UNIX it appears as MAR�A MENDOZA. Is there anyway to overcome this? Its causing a issue because the file is Postional and fields are getting pushed by 2 digits.. Any help would be... (4 Replies)
Discussion started by: venky338
4 Replies

4. Shell Programming and Scripting

Replace special characters with Escape characters?

i need to replace the any special characters with escape characters like below. test!=123-> test\!\=123 !@#$%^&*()-= to be replaced by \!\@\#\$\%\^\&\*\(\)\-\= (8 Replies)
Discussion started by: laknar
8 Replies

5. Shell Programming and Scripting

FTP automation script

Hi, I have got a requirement like this. a parameterized function custFtp which will take 5 i/ps and will do the following tasks. p1) server name p2) username p3) password p4) path name of the server where the file resides p5) file name pattern the function will work like this. ... (1 Reply)
Discussion started by: ani_datta
1 Replies

6. UNIX for Advanced & Expert Users

FTP automation Job scheduling

Hi, I am working in Unix and Teradata fastload. I need to automate file transfer through ftp from windows path to Unix directory at a specific time, then I should call fastload scripts execution. I have got the fastload script. Entire process should be automated without any manual intervention. It... (1 Reply)
Discussion started by: SATYAPRIYA_D
1 Replies

7. Filesystems, Disks and Memory

Urgent FTP script automation

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies

8. UNIX Desktop Questions & Answers

Urgent FTP script automation

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies

9. UNIX for Dummies Questions & Answers

Urgent FTP script automation

Hi guys, Here is my requirement for ftp script that i have to automate in unix using shell script: 1) Find the files that atre created one week from the present day. 2) ftp them to the backup server. 3) At the end of the month make a new directory on my backup server with the new month(eg:Once... (1 Reply)
Discussion started by: koduri0475
1 Replies

10. UNIX for Dummies Questions & Answers

Automation of telnet and ftp

I have a basic query. I use telnet and ftp very frequently. I want to do it without spending time in typing username and password everytime. I know that if I have .netrc file which contains server address, username, pasword, then just typing ftp will conect to that server with that username and... (10 Replies)
Discussion started by: asutoshch
10 Replies
Login or Register to Ask a Question