![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script to search for text in a file and copy file | imeadows | UNIX for Dummies Questions & Answers | 9 | 11-12-2008 09:12 PM |
| search for the contents in many file and print that file using shell script | cdfd123 | Shell Programming and Scripting | 3 | 10-07-2007 10:17 PM |
| Have a shell script check for a file to exist before processing another file | heprox | Shell Programming and Scripting | 3 | 11-14-2006 03:26 AM |
| Shell Script to Load data into the database using a .csv file and .ctl file | Csmani | Shell Programming and Scripting | 3 | 05-24-2006 08:09 AM |
| Reading file names from a file and executing the relative file from shell script | anushilrai | Shell Programming and Scripting | 4 | 03-10-2006 05:25 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
shell script to ftp a file
Hi
I would like to construct a UNIX shell script which when run, it will log on to an existing ftp server using a generic account and password, then list the files in a specific folder that begins with the string "abc" and particular date. The file names along with their creation date are then to be extracted on a csv file (or similar) to other server. Can any one be able to help me on this please? thanks, Manish |
|
||||
|
Try below script. Assign the appropriate values to the variables. mget fetches the multiple files with the specified condition.
#!/usr/bin/ksh HOST='Your_Host_To_Connect' USER='USER_ID' PASSWD='PASSWORD' DIRPATH=/home/manish/Files echo "Fetching the requested data. Please wait..." ftp -i -n $HOST <<EOF user ${USER} ${PASSWD} mget abc* quit EOF echo "Done." |
|
||||
|
To print the results in a file, you may use the below command
ftp -i -n $HOST <<EOF > FileName |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| shell script, unix find |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|