Sponsored Content
Full Discussion: error with ftp
Top Forums Shell Programming and Scripting error with ftp Post 302342774 by Scott on Monday 10th of August 2009 05:48:08 PM
Old 08-10-2009
Based on the code you've shown, I can see no error.

(substituting ftp... for cat to test...)
Code:
echo "Enter ip "
read ans_ip
echo "Enter environment[sandbox/production]"
read ans_env
echo "Enter Datacenter [dc1/dc2]"
read ans_dc
 
loop()
{
cat << EOF
user user pwd
bin
prompt
cd /tmp
mget ${ans_ip}.tar
bye
EOF
}
 
if [[ "$ans_env" = "sandbox" && "$ans_dc" = "dc1" ]]; then
loop
fi
 
Text:
Enter ip 
123.123.123.123
Enter environment[sandbox/production]
sandbox
Enter Datacenter [dc1/dc2]
dc1
user user pwd
bin
prompt
cd /tmp
mget 123.123.123.123.tar
bye
/root # echo $?
0

Are you showing us the entire script?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ftp error

All, I am getting the following error while I am trying to ftp a file. I am able to log into the destination server. But, when I try to put the file, I get the following error: 426 Connection closed; transfer aborted. Any ideas are appreciated. ThankYou, Radhika. (1 Reply)
Discussion started by: radhika
1 Replies

2. UNIX for Dummies Questions & Answers

Error when trying to FTP..

Ok, currently we ftp a file from our Unix server to windows and then to a secureftp.'something'.com site. I am trying to bypass the windows server piece. But when I try to ftp directly from Unix to secure.'something'.com site, I see this error: 220 Check Point FireWall-1 Secure FTP server running... (7 Replies)
Discussion started by: NycUnxer
7 Replies

3. Shell Programming and Scripting

ftp error

This used to work , but know I am getting errors: 331 Enter password 230 User logged in 250 Command CWD succeed 200 Transfer mode set to BINARY local: arc-090715.tar.gz remote: arc-090715.tar.gz local: arc-090715.tar.gz: No such file or directory Any idea what is wrong? Thank you in... (2 Replies)
Discussion started by: Lenora2009
2 Replies

4. Shell Programming and Scripting

ftp error

While log in to ftp server with valid username & password I receive the following error. Please advice. ftp: Login failed. ftp: bind: Address already in use cat .netric machine hostnameofmachine login username password passwordstring .netric file set to chmod 0600 $HOME/.netrc (1 Reply)
Discussion started by: zooby
1 Replies

5. Shell Programming and Scripting

FTP Error 553 I/O error.

Hi All, I have a problem when uploading txt file from windows to Unix server. I got 533 I/O error. I am using .bat file and it works for other batches but with this particular batch it doesn't work. thanks guys for helping in advance. (2 Replies)
Discussion started by: sfaqih
2 Replies

6. UNIX for Advanced & Expert Users

FTP error

Hi Guys, Unable to FTP random files. Getting the following error message Net::FTP=GLOB(0x88c4c88)>>> ALLO 21754200 Net::FTP=GLOB(0x88c4c88)<<< 202 ALLO command ignored. Net::FTP=GLOB(0x88c4c88)>>> PORT 11,160,36,109,135,42 Net::FTP=GLOB(0x88c4c88)<<< 200 PORT command successful.... (1 Reply)
Discussion started by: gauravgoel83
1 Replies

7. AIX

FTP error

While doing ftp I am getting below error. Plz help how to resolve this? OOPS: close OOPS: child died No control connection for command: Error 0 No control connection for command: Error 0 No control connection for command: Error 0 No control connection for command: Error 0 No control... (2 Replies)
Discussion started by: suresh3566
2 Replies

8. Shell Programming and Scripting

ftp error.

i try to put files to ftp server. but i got "550 Command STOR failed" error. can u help me about this error? my codes: -bash-3.00$ ftp xxx.com Connected to xxx.com 220 xxx.com X2 WS_FTP Server 7.5(39687500) Name (xxx.com:oracle): user 331 Enter password Password: 230 User logged in... (2 Replies)
Discussion started by: imtheone
2 Replies

9. IP Networking

FTP error

Hi, While doing FTP am getting an error like Connected to xxxx (xxxx). 220 (vsFTPd 2.0.5) Name (xxxx:nn): yy 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> dir */*/*/*.zip 227 Entering Passive... (6 Replies)
Discussion started by: weknowd
6 Replies

10. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies
SHTOOL-ECHO.TMP(1)					      GNU Portable Shell Tool						SHTOOL-ECHO.TMP(1)

NAME
shtool-echo - GNU shtool echo(1) extensional command SYNOPSIS
shtool echo [-n|--newline] [-e|--expand] string DESCRIPTION
shtool echo is an echo(1) style command which prints string to stdout and optionally provides special expansion constructs (terminal bold mode, environment details, date, etc) and newline control. The trick of this command is that it provides a portable -n option and hides the gory details needed to find out the environment details under option -e. OPTIONS
The following command line options are available. -n, --newline By default, output is written to stdout followed by a "newline" (ASCII character 0x0a). If option -n is used, this newline character is omitted. -e, --expand If option -e is used, string can contain special "%x" constructs which are expanded before the output is written. Currently the following constructs are recognized: %B switch terminal mode to bold display mode. %b switch terminal mode back to normal display mode. %u the current user name. %U the current user id (numerical). %g the current group name. %G the current group id (numerical). %h the current hostname (without any domain extension). %d the current domain name. %D the current day of the month. %M the current month (numerical). %m the current month name. %Y the current year. EXAMPLE
# shell script shtool echo -n -e "Enter your name [%B%u%b]: "; read name shtool echo -e "Your Email address might be %u@%h%d" shtool echo -e "The current date is %D-%m-%Y" HISTORY
The GNU shtool echo command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1998 for Website META Language (WML) under the name buildinfo. It was later taken over into GNU shtool. SEE ALSO
shtool(1), echo(1). 18-Jul-2008 shtool 2.0.8 SHTOOL-ECHO.TMP(1)
All times are GMT -4. The time now is 04:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy