Share your knowledge at the LQ Wiki.
Go Back > Forums > Other *NIX Forums > AIX
User Name
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.


  Search this Thread
Old 07-26-2005, 11:51 AM   #1
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

#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, 10:31 PM   #2
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:

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


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 05:29 PM
firewire error - Error logging into SBP-2 device eddi.b Linux - Hardware 1 09-25-2004 09:37 AM
Trapping NFS requests Jayendra Linux - Networking 0 03-01-2004 09:17 AM
Trapping an exit status chrisk5527 Linux - General 3 09-12-2003 09:02 PM
Trapping keystrokes in C k4zau Programming 3 03-09-2003 01:13 PM > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 07:41 AM.

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