![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| awk Shell Script error : "Syntax Error : `Split' unexpected | Herry | UNIX for Dummies Questions & Answers | 2 | 03-17-2008 08:16 AM |
| Newb scripting question, I get the error script not found | Arkitech | Shell Programming and Scripting | 3 | 05-04-2006 07:55 AM |
| difference between AIX shell scripting and Unix shell scripting. | haroonec | Shell Programming and Scripting | 2 | 04-12-2006 05:12 AM |
| scripting guru's pls help me with scripting on AIX | thatiprashant | Shell Programming and Scripting | 1 | 01-20-2006 04:58 PM |
| Error: Internal system error: Unable to initialize standard output file | firkus | UNIX for Dummies Questions & Answers | 2 | 10-25-2005 12:23 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Error in scripting ftp
Good Morning,
I just would like to know what is wrong with my script. I am trying to use a for loop on my ftp command but the part that pipes the ftp information is reported in unix as error. Here's my script : #!/bin/ksh # other parts of the script here.... # get all ORD* files created and then ftp it to the other server... cd $PRODATA ORDDOWNLD=`ls ORD????.DLD` # test data - ORDDOWNLD='ORD8705.DLD ORD8706.DLD ORD8707.DLD' # then delete e_downso.txt # Above file is the source of records for ORD files. Once #our system did not find the file "e_downso.txt", it will #generate another ORD file, which is ok because it will not #be part of the list.... # I could also add a logic to rename the ORD* files in the #list variable so that other process running this same script # will not pick this file again..... export ORDDOWNLD for i in $ORDDOWNLD do # transfer ORD files one by one...... ftp -n -v wms > josephtest.log <<- ! user test test^M cd done put $i get $i J$i quit^M ! # compare if ORD in WMS is equal to what is in GLOVIA... diff $i J$i # then test if there is difference,,,if none, then delete $i..... # else send an email to helpdesk to inform users that part of $i was not copied to WMS... done #=================end of script================================= After running above script, I am getting the following error : /glo71sw/716/devl/userdata/scripts --> ./josephtest.k> ./josephtest.ksh[7]: syntax error at line 12 : `<<' unmatched /glo71sw/716/devl/userdata/scripts --> Please advise. Basically, our goal is to make sure the ORD file we ftp to the other server is the same copy as in our source server. The source of the ORD file is getting updated by many users that is why after getting the list of ORD* files, Thank you very much! Joseph |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Joseph,
the "<<- !" in line 12 is basically the start of what gets sent to the ftp log. Right below the "quit" line you should have the terminating string to say when to stop sending the output to the ftp log. You have a single "!" instead of a "- !" that you have at line 12. Scripts at my company usually use a *** as a starting and stopping point. ftp -nv >> ftplog.log <<*** open user get put quit *** I do not think it matters what is used as long as it matches the string at the start. ; Last edited by SemiOfCol; 06-07-2005 at 09:09 AM. |
|
#3
|
|||
|
|||
|
Thanks SemiOfCol!
I will try it out...I thought the "-" is part of the "<<" command....I will replace the "!" with the EOF. Joseph |
|
#4
|
|||
|
|||
|
I am still getting the same error even after replacing "<<- !" and "!" with "<<EOF" and "EOF". Help!
Thanks! Joseph |
|
#5
|
||||
|
||||
|
remove '^M' from your script - use dos2unix [if you have one]
[or vi/sed] |
|
#6
|
|||
|
|||
|
Thanks!
I tried removing the "^M" but I am still getting the error. Is it possible to run "ftp" inside a for loop like what I am doing? Please help.. Thanks! Joseph |
|
#7
|
||||
|
||||
|
Quote:
|
||||
| Google The UNIX and Linux Forums |