Hi All,
I am facing a alien problem in unix shell script.
i have a requirement where i have to check first whether a particular file has been created or not if that file has been created then that file needs to be ftped to a particular dir.
My Code is like that
Success='code for file creation which return OK or NOTOK'
if [ "$Success" == "OK" ]; then
ftp -inv<<EOF
open 00.00.00.00
user $username $password
cd /home/unix
ascii
put <file name>
bye
EOF
fi
Now when i execute this statement it gives me syntax error "at line number xyz: '<' is not matched"
When i remover one < from my code "ftp inv<EOF" then it gives me an error
"at line number xxx: 'then' is not matched"
When i am putting this ftp command outside the if condition it is working fine.
Kindly help me out.
Thanks
Aryan