Home » Infrastructure » Unix » unix shell script is not executing .
unix shell script is not executing . [message #216150] Thu, 25 January 2007 05:15 Go to next message
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 Go to previous messageGo to next message
ThomasG
Messages: 3189
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.





Re: unix shell script is not executing . [message #216170 is a reply to message #216169] Thu, 25 January 2007 07:30 Go to previous message
ThomasG
Messages: 3189
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Oh, and make shure there is no blank before or after the second "EOF"

Previous Topic: Oracle/SunOS query
Next Topic: HP-UX need help
Goto Forum:
  


Current Time: Fri Dec 09 08:08:11 CST 2016

Total time taken to generate the page: 0.04875 seconds