![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| 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 |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Can you ftp to the as400 manually?
|
|
#5
|
|||
|
|||
|
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
|
||||
|
||||
|
Instead of Machina:/directory > p7f800.bat
try Machina:/directory > ./p7f800.bat |
|
#7
|
|||
|
|||
|
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 |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|