Linux / UNIX Tech Support Forum
This is a discussion on FTP SHELL Script within the Shell scripting forums, part of the Development/Scripting category; hI, CHK MY SCRIPT Code: hostname="sol" ftp sol >>EOF mkdir anything cd anything put quit EOF the output it gives ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
hI,
CHK MY SCRIPT Code:
hostname="sol" ftp sol >>EOF mkdir anything cd anything put quit EOF I want to write a ftp script that run with no human intervention.
Last edited by nixcraft; 24-04-2009 at 05:15 PM. Reason: Formatting |
| Sponsored Links | ||
|
|
|
||||
|
Try it as follows and let me know if it works or not...
Code:
#!/bin/bash hostname="sol" username="ftpuser" password="ftppassword" ftp -n $hostname >>EOF user $USER $PASSWD mkdir anything cd anything put file quit EOF
__________________
Vivek Gite Linux Evangelist Last edited by nixcraft; 24-04-2009 at 05:29 PM. |
|
|||
|
hey thnx for reply
hey the command u said for login ftp sol thats didnt work. well when i do ./ftp it stops and doestnt display anything. but when i do ls i can see the directory what i have typed in.
|
|
||||
|
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 Code:
chmod +x ftpscript.sh Code:
./ftpscript.sh
__________________
Vivek Gite Linux Evangelist |
![]() |
| Tags |
| ftp , ftp login , ftp script |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Guide me about shell script | k.gopalreddy | Shell scripting | 2 | 04-03-2009 03:43 PM |
| shell script for ftp | chaharvikram | Shell scripting | 0 | 09-10-2008 06:24 PM |
| Binary Conversion Of Shell Script (shell script compiler) | chandanperl | Shell scripting | 3 | 29-07-2008 10:22 AM |
| How to initialize HDD using Shell script? | meimei | Shell scripting | 1 | 13-05-2008 05:21 PM |
| writing a shell script to find out my shell name | jaymob123 | Shell scripting | 1 | 08-10-2007 12:36 AM |