LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 07-26-2005, 12:51 PM   #1
Risc91
Member
 
Registered: Jan 2002
Location: Macomb, MI
Distribution: Ubuntu|Red Hat ES|AIX
Posts: 161

Rep: Reputation: 30
ksh Error trapping/logging


I have the following code in a script of mine

Code:
#connect to FTP and get file
ftp -nv >&4 2>&4 |& 

print -p open $HOST
print -p user $USER $PASSWD
print -p binary
print -p prompt n
print -p cd tocu 
print -p mget $filename*
print -p bye
Is there anyway to check that each command has completed successfully? I guess I need to know how to extract the return value of an ftp command.
 
Old 07-28-2005, 11:31 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Whenever I have to script ftp, I use the ncftp client. it's free and much better suited for scripting; hell it's a better interactive client as well. It will turn you 8 line script into a single statement.

man page:
http://www.ncftp.com/ncftp/doc/ncftpget.html

If installing a new client is not an option, I'll take a stab at the script.
 
  


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
trapping packets mohit_garg Linux - Networking 6 07-10-2005 06:29 PM
firewire error - Error logging into SBP-2 device eddi.b Linux - Hardware 1 09-25-2004 10:37 AM
Trapping NFS requests Jayendra Linux - Networking 0 03-01-2004 10:17 AM
Trapping an exit status chrisk5527 Linux - General 3 09-12-2003 10:02 PM
Trapping keystrokes in C k4zau Programming 3 03-09-2003 02:13 PM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 06:46 PM.

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