KSH n FTP query


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting KSH n FTP query
# 1  
Old 07-05-2006
KSH n FTP query

Hi,

I have this slightly modified FTP code (thanks to this forum)
Code:
function gather_FTPDate {
	HOST=
	USER=
	PASSWD=

	exec 4>${TEMP_LOG_FILE}
	ftp -nv >&4 2>&4 |&

	echo $?

	if [[ $? -ne 0 ]] then
		echo "Unable to connect to FTP server!!!" >> ${LOG_FILE}	
		return 0
	fi

	print -p open $HOST
	print -p user $USER $PASSWD
        ...
	print -p bye

	wait
}

The problem is with the if loop. How do i check if the connection to the FTP server is a success or failure? Even when the connection times out, i get a return code of 0.

Thanks.
# 2  
Old 07-07-2006
Bump... Anyone?
# 3  
Old 07-11-2006
Sorry for the bump again...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Perform SQL query then FTP

Hi All, Would like to ask if its possible to perform sql query in another machine and then the output will be sent back to local via ftp. Machine1 - home server Machine2 - 2nd server Scenario: will perform sql query in Machine2 then put it into temp table then the temp table will be... (2 Replies)
Discussion started by: znesotomayor
2 Replies

2. Shell Programming and Scripting

Asign to variable ksh some values of sql query

Hi, I'm trying to asign to ksh varible some values of a sql query. The output query would be: xxxx 1 yyyy 2 I do: values=`$PATH_UTI/query_sh " select think1||'------'||think2 from some_table where think3 = '$1'; ... (2 Replies)
Discussion started by: mierdatuti
2 Replies

3. Shell Programming and Scripting

FTP Query

Hi, I have to migrate the scripts from source(HP UX) to destination(Linux) some files. While ftp and downloading the files, the permissions of the files are changing. Is there any option in ftp to get the file in exact permissions. I believe we can achieve it by using tar, however i am... (3 Replies)
Discussion started by: nag_sathi
3 Replies

4. Shell Programming and Scripting

Beginner in ksh - umask query

I started to learn KSH I am doing some exercises from the book $ umask =rx, u+w $ print Keep track of everythine > file1.out $ print Be careful >> file1.out ksh: file1.out: cannot create $ umask -S ... (1 Reply)
Discussion started by: solaris_user
1 Replies

5. Shell Programming and Scripting

to find whether update query is successfull or not using Ksh Script

i have a script that performes an update operation. I just wanted to know whether that update statement is successfull or not. Below the script: #!/bin/ksh . $HOME/conf/systemProperties/EnvSetup.properties sqlplus -silent sie/da@edn.world <<END set pagesize 0 feedback off verify off... (3 Replies)
Discussion started by: ali560045
3 Replies

6. Shell Programming and Scripting

FTP inv tee Query

Hi, This is part of a ftp script, Can someone please explain what is its functionality or the basic idea behind it and please throw some light on the inv & tee function marked in red. echo "bye" ) | ftp -inv | tee -a ${DOWNLOAD_LOG} | awk '{ print $0 } /^5.*/ { print "\n\t\t\tFTP session had... (1 Reply)
Discussion started by: openspark
1 Replies

7. UNIX for Dummies Questions & Answers

Query a DB from another DB in ksh

I'm trying to connect to a DB on a windows server from a DB on a unix server. While I can connect, I can't seem to get the expected results back, I'm only getting the number "2" back no matter what date I put in (I should be getting "408" or "410" depending on the date). Funny, when I go into... (1 Reply)
Discussion started by: tekster757
1 Replies

8. Shell Programming and Scripting

Query regarding ksh

I wrote a script in ksh as follow: echo "Hello" if ; then echo "bye" else echo "Welcome" fi i ran this script two time with different syntax like this: ~/my_temp > ./test.ksh Hello bye ~/my_temp > test.ksh WIDTH: 12 WIDTH: 17 RELEASE (4 Replies)
Discussion started by: vaibhav
4 Replies

9. Shell Programming and Scripting

passing result of query to a varibale in ksh script

Hi, I have a scenario where in i have to extarct max of one column and pass it to a variable. i have tried to export the result as .dat file and read from that file.But my database is mainframe and it is not permitting me to export in .dat file.I have tried using .ixf file but reading from... (2 Replies)
Discussion started by: ammu
2 Replies

10. UNIX for Advanced & Expert Users

FTP query

Hi there, Can anyone tell me how to use FTP so that I can pipe a text file with FTP commands in. I'd like to use this method in my korn shell so that I can log onto a remote server and collate listings of specific files. Here's what I'm trying to do: ftp -v host_server < ftp_command_file ... (1 Reply)
Discussion started by: csong2
1 Replies
Login or Register to Ask a Question