The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Executing Windows batch file from UNIX flip387 Shell Programming and Scripting 5 10-24-2008 08:57 AM
batch file using sed command in msdos rita1985 UNIX for Dummies Questions & Answers 1 01-14-2008 11:19 PM
How can I run scripts in my unix account from batch file in Windows? olgafb UNIX for Dummies Questions & Answers 7 05-27-2006 06:40 AM
batch file equivalent for Unix megastar UNIX for Advanced & Expert Users 1 10-12-2005 03:20 PM
Using Batch command jhansrod Shell Programming and Scripting 5 06-10-2005 09:50 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-13-2002
Registered User
 

Join Date: Aug 2002
Location: Toronto, Ontario, Canada
Posts: 6
UNIX Batch FTP Command file

Hello, I am a UNIX newbie and this is my first posting.

I need to create a batch command file to ftp from Sun/Solaris to AS/400.

Here is an example file:

ftp -d -i -n -v 172.28.16.22
pwd
ls
binary
quit

This is the result of executing the command file:

Connected to 100.10.10.100.
220-QTCP at AS400-TEST.test.test.com.
220 Connection will close if idle more than 5 minutes.
---> QUIT
221 QUIT subcommand received.
/test/ts000415
stderr.log
stdout.log
sysh.tmp
/p7f800.bat: binary: not found
/p7f800.bat: quit: not found

It appears that a QUIT command is automatcially generated and the pwd and ls commands are not operating on the remote syste but on the local one.

Note, I have a .netrc file in my UNIX home directory with machine, login and password.

Any help would be appreciated.

Thank you,

Pietro
Forum Sponsor
  #2  
Old 08-13-2002
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
One thing that is wrong is you are using -n in the ftp command. Read the man page on ftp. The -n tells it to NOT attempt an auto-login (ignores .netrc).
  #3  
Old 08-13-2002
Registered User
 

Join Date: Aug 2002
Location: Toronto, Ontario, Canada
Posts: 6
OK. I removed the -n. Logged in successfully but still QUITting.

Connected to 100.10.10.10.
220-QTCP at AS400-TEST.test.test.com.
220 Connection will close if idle more than 5 minutes.
---> USER FTPUSER
331 Enter password.
---> PASS test99
230 FTPUSER logged on.
---> QUIT
221 QUIT subcommand received.
/edatemp/ts000416
stderr.log
stdout.log
sysh.tmp
/test/xxf800.bat: binary: not found
/test/xxf800.bat: quit: not found
  #4  
Old 08-13-2002
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Can you ftp to the as400 manually?
  #5  
Old 08-13-2002
Registered User
 

Join Date: Aug 2002
Location: Toronto, Ontario, Canada
Posts: 6
Yes, I just ftp's to the AS/400.

I am trying to run the batch file from a telnet session. I've navigated to the directory where my batch file is. I do a ls and I see the file (p7f800.bat). But when I try running it

Machina:/directory > p7f800.bat

I get:

ksh: p7f800.bat: not found

Am I doing something wrong?

Thanks,

Pietro.
  #6  
Old 08-13-2002
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Instead of Machina:/directory > p7f800.bat

try Machina:/directory > ./p7f800.bat
  #7  
Old 08-13-2002
Registered User
 

Join Date: Aug 2002
Location: Toronto, Ontario, Canada
Posts: 6
I have executed the bat file.

This is the result:

Connected to 100.10.10.100.
220-QTCP at AS400-TEST.test.test.com.
220 Connection will close if idle more than 5 minutes.
---> USER FTPUSER
331 Enter password.
---> PASS blahblah
230 FTPUSER logged on.
ftp> quit
---> QUIT
221 QUIT subcommand received.
./p7f800.bat[2]: lcd: not found
./p7f800.bat[3]: put: not found
./p7f800.bat[4]: quit: not found

I entered the lowesr case "quit" command as it seems ftp is in interactive mode - I would like to automatically continue to the lcd command.

Thanks,

Pietro.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0