putting ftp in korn function - no longer working


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting putting ftp in korn function - no longer working
# 1  
Old 10-17-2007
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
}
# 2  
Old 10-17-2007
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?
# 3  
Old 10-17-2007
Thank you! That may be it. I know it's not in the first column.
# 4  
Old 10-17-2007
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
}
# 5  
Old 10-17-2007
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"
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

awk program date function no longer running

I work at a company that uses a program written in AWK to track various data and prepare reports. Worked with this program for three years plus (the author is no longer with us) and the YTD Production report will not return a report with a date after 123119. This is a problem. Below is the (I... (3 Replies)
Discussion started by: paulgdavitt
3 Replies

2. Post Here to Contact Site Administrators and Moderators

LinkedIn tiles on Members list no longer working?

Is it just me or are the links to LinkedIn on the "Members" list not working any more? Clicking on Facebook, YouTube, etc work just fine. I'm getting a 404 error (page no longer exists) but I know for sure that my page is there. Perhaps there's something wrong with my browser? Any ideas? (7 Replies)
Discussion started by: hicksd8
7 Replies

3. Linux

Chrome browser no longer working on my debian lenny 5

Hi All, My chrome browser was working correctly on my Debian Lenny 5 PC..Today i downloaded the version from google and tried to install the deb from command line as follows: dpkg -i <latest-chrome-package> The installation failed but now my existing old chrome browser is not starting. ... (2 Replies)
Discussion started by: coolatt
2 Replies

4. UNIX for Dummies Questions & Answers

vnc No Longer Working Correctly

Hello All, Yesterday, all day, I was using x11vnc and vncviewer to connect to a server. But today for some reason it is not working. I don't remember changing any settings or anything like that, but because it stopped working correctly I guess something has...? I'm issuing the exact same... (0 Replies)
Discussion started by: mrm5102
0 Replies

5. UNIX for Dummies Questions & Answers

Script is not longer working in the crontab

This is the crontab it is supossed to be running everyday but it didnt 5 0 * * * /export/app/CO/opge/scr/Informe_parametros_colombia.ksh >/dev/null 2>&1 Inside the above script connects to a database and extract data to a flat file, manually i run the script at about 2 a.m. and Works OK,... (6 Replies)
Discussion started by: alexcol
6 Replies

6. UNIX for Dummies Questions & Answers

rm /var/db/.AppleSetupDone no longer working for mac OS X 10.6??!? HELP!!!!

My roommate forgot his admin password on his MacBook air.. He doesn't have the external SuperDrive, so we have no way of using the simple method of using the install disks and resetting the password.. The worst part is, he did this same thing about a year ago lol At the time, we booted... (0 Replies)
Discussion started by: PhiGam
0 Replies

7. Shell Programming and Scripting

korn shell - export function??

Hi, I have a question. I know that if I want to access any variables defined in a calling script (script1.ksh) in a called script (script2.ksh) I need to export that variable in the calling script to make it available in the called script. But what about the functions in the calling script? ... (1 Reply)
Discussion started by: dips_ag
1 Replies

8. IP Networking

ftp waits for longer time to reply

If i fire followin command on unix (linux/solaris) and windows ftp serverX where serverX is not in the network, it takes more time to get reply on unix(3-4 mins) rather windows(1 min), can anybody tell me why this happens? and how to reduce this time span? (1 Reply)
Discussion started by: amolwar
1 Replies

9. SCO

Sco-Unix IP Printer no longer working

I have a client running Sco-Unix 5. They have many IP Printers setup. One of the IP Printers is "LPJ", it has been functional for 3 weeks and then the switch died and hung up the queue. We reset the switch and restarted the jobs and they printed. The switch went down again and we replaced the... (1 Reply)
Discussion started by: Netwrkengeer
1 Replies

10. Forum Support Area for Unregistered Users & Account Problems

my account is no longer working

my account mhm4 is no longer working (9 Replies)
Discussion started by: mhm4
9 Replies
Login or Register to Ask a Question