LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-24-2003, 03:24 PM   #1
pldobs
Member
 
Registered: Nov 2002
Distribution: 8.0
Posts: 34

Rep: Reputation: 15
ksh script problem


I am trying to create an script to ftp a file to a server using a guest account with no password. Manually, I would log in as "guest" and when prompted for a password, simply press the enter key. This has been tested and works fine. I have the following script to attempt to automate the process:

###CODE START####
ftp -n 10.1.12.253 << EOF
user guest

cd /sys/BACKUP
bin
put test
quit
EOF
###CODE END####


It works fine except it requires me to press the return key for the password before sending the rest of the lines. In other similar scripts, the blank line after "user guest" prevents the user from having to press the return key after the password prompt.

This code seems to work sometimes but not all the time

Last edited by pldobs; 12-24-2003 at 03:28 PM.
 
Old 12-24-2003, 04:32 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Did you try turning off prompting?
Code:
ftp -n -i 10.1.12.253 << EOF
user guest
cd /sys/BACKUP
bin
put test
quit
EOF
 
Old 12-24-2003, 11:38 PM   #3
pldobs
Member
 
Registered: Nov 2002
Distribution: 8.0
Posts: 34

Original Poster
Rep: Reputation: 15
Thanks for the suggestion. I just tried it with the "-i" but got the exact same results. I wonder if it is just the ftp server I am logging into. I know this same code works in many other instances with other ftp servers.

Last edited by pldobs; 12-25-2003 at 12:40 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gpg from ksh script Risc91 AIX 2 05-11-2005 10:45 AM
ksh math script SeT Programming 10 10-13-2004 08:06 AM
ksh directory comparison script SeT Programming 4 08-30-2004 11:57 AM
Can somebody help me with a ksh script? twentymil AIX 7 01-21-2004 09:55 AM
KSH script AquamaN Programming 2 12-08-2003 11:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration