The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sco-Unix IP Printer no longer working Netwrkengeer SCO 1 01-17-2008 12:28 PM
korn shell to bash - statement not working brdholman UNIX for Dummies Questions & Answers 5 10-15-2007 06:49 AM
my account is no longer working mhm4 Forum Support Area for Unregistered Users & Account Problems 9 04-11-2007 05:45 PM
putting a timestamp in a file rocker40 UNIX for Dummies Questions & Answers 2 10-22-2003 08:56 AM
Putting pC on network Rush UNIX for Dummies Questions & Answers 1 11-22-2002 12:33 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-17-2007
Registered User
 

Join Date: Sep 2007
Posts: 26
putting ftp in korn function - no longer working

This works if it's not in a function. I pulled it into one and I get syntax error, no mathcing '<'. I have to call it several times and need it to be a function. Any ideas?

function FTP_Engine_File {

ftp -inv ${FTP_SERVER} << EOF_FTP >> ${FTP_LOG}
user ${FTP_USER} ${FTP_PSWD}
cd ${FTP_DIR1}
cd ${FTP_dir2}
bin
mget ${FTP_FILE}
quit
EOF_FTP

mv engine.tar.Z $HOME/"$CURRENT_VERSION"/"$test_type/engine.tar.Z
}
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-17-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Let me guess, you have some whacky indentation that we can't see due to the formatting of your post such that the EOF_FTP is not in the first column?
Reply With Quote
  #3 (permalink)  
Old 10-17-2007
Registered User
 

Join Date: Sep 2007
Posts: 26
Thank you! That may be it. I know it's not in the first column.
Reply With Quote
  #4 (permalink)  
Old 10-17-2007
Registered User
 

Join Date: Sep 2007
Posts: 26
It's all in the first column and now getting an unmatched '{'. I've been looking for an online resource with examples of functions without much luck. I'm new at this so sorry if this is an elementary issue.


function FTP_Engine_File {
ftp -inv ${FTP_SERVER} << EOF_FTP >> ${FTP_LOG}
user ${FTP_USER} ${FTP_PSWD}
cd ${FTP_DIR1}
cd ${FTP_dir2}
bin
mget ${FTP_FILE}
quit
EOF_FTP
mv engine.tar.Z $HOME/"$CURRENT_VERSION"/"$test_type/engine.tar.Z
}
Reply With Quote
  #5 (permalink)  
Old 10-17-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
1. Please post your code in [ CODE ] brackets, there is even a little button above to do this.

2. why people use this bash function construct is beyond me, why not use the portable

Code:
my_function()
{

}
construct?

3. your quotes don't balance on the final "mv"
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:33 AM.


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

Content Relevant URLs by vBSEO 3.2.0