What kind of error do you see on screen? Here is another example. Set First 3 variables and create script called ftpscript.sh as follows:
Code:
#!/bin/bash
FTPHOST='SET.ftp.example.com-HERE'
USR='SET-FTP-USER-NAME-HERE'
PASS='SET-FTP-PASSWORD-HERE'
ftp -n $FTPHOST <<EOF
USER $USR
PASS $PASS
ls
mkdir dir
cd dir
put /etc/hosts
quit
EOF
exit 0
Then set permissions:
Code:
chmod +x ftpscript.sh
Run it as follows: