bash - ftp doesn't work within a function
HI
The following code works:
/usr/bin/ftp <<ENDFTP
open $intranet_server
cd $intranet_publish
mput $csv_output-*
y
bye
ENDFTP
The problem is when it's within an if statement or called from within a function. In both cases I get the error line (lastline): syntax error: unexpected end of file.
If I remove the << the function executes (though of course doesn't actually do anything)
Is there something I should be doing to escape the <<?
Thanks for any assistance.- Richie-451
|