Link to home
Start Free TrialLog in
Avatar of tooki
tooki

asked on

Shell script commands NOT executing!!

This is my exact script:
The scipt ignore the part of the script after the FTP function. The echo statements never execute. Those echo parts work when I get rid of the upper FTP parts..
What's wrong??
====================
#!/bin/sh
cd /tmp
/bin/ftp -nv 190.1.100.100 << -EOF
user test1 abc123
hash
get test_file.txt
close
EOF

ret=`/usr/bin/diff /tmp/test_file.txt /export/usr1/test_file.txt`
echo "it is not going to output!!!!!!!!!!"
if [ $? -ne 0 ] ; then
echo "something!!!"
fi
=====================
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tooki
tooki

ASKER

It worked after I fixed that error ("-EOF"...)!!!!

many Thanks!!!!
"<<-" strips leading <TAB>s off the "here" document, so you can have your script prettily indented, e.g.

... <<-  EOF    
<TAB> input
<TAB>       <TAB>more input
<TAB>  EOF


But it often causes confusion, so you're better off without it ;-)