View Single Post
  #4 (permalink)  
Old 24th April 2009, 05:32 PM
nixcraft's Avatar
nixcraft nixcraft is offline
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,195
Thanks: 13
Thanked 394 Times in 292 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

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:
Code:
./ftpscript.sh
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog
Reply With Quote