unix shell script is not executing . [message #216150] |
Thu, 25 January 2007 05:15 |
frank.svs
Messages: 162 Registered: February 2006
|
Senior Member |
|
|
Hi , I wrote a function but it is showing still errors, simply i am connected my ftp server and copying files and put it on ftp server.
This is what i have done.
$cat test
TEST()
{
ftp -n -v <<-EOF
open 192.168.0.108
user mohan hellohowru
binary
case
cd $HOME/prod/smdss/files/
mget req_detail*
bye
EOF
}
TEST
$./test
./test: line 16: syntax error: unexpected end of file
$
Why iam getting error.
Regards,
franky
|
|
|
Re: unix shell script is not executing . [message #216169 is a reply to message #216150] |
Thu, 25 January 2007 07:29 |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Hi,
What Unix and what shell is it ?
I just tried it on Linux with bash, and on AIX with bash and ksh, there it worked every time.
Maybe either the current shell has a problem with functions, or there are mabye funny non-printable characters in the script, that don't show up in the cat?
Maybe put a she-bang like
#!/usr/bin/bash
at the start, to execute it with a specifc shell.
|
|
|
|