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
=====================
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
"<<-" 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 ;-)
... <<- EOF
<TAB> input
<TAB> <TAB>more input
<TAB> EOF
But it often causes confusion, so you're better off without it ;-)
ASKER
many Thanks!!!!