![]() |
Hello and Welcome from 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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Need a FTP help
Hi,
After connecting to the remote server by using FTP i need to know the file name residing on the remote path....So that that file name i can pass as a parameter to the main program...FTP program will get called from the main program.... Please let me know the solution. |
|
||||
|
sorry .. i am not able to undrstand ur requirement.
You should know the filename you want to FTP !!! there can be lots of files in any specific remote path.... You can get them listed by "ls". Last edited by anchal_khare; 02-24-2009 at 10:30 AM.. |
|
||||
|
This is one approach...
Getval=`ftp -n -i $RemoteHost <<EOF 2>&1 user $user $Passwd cd $RemotePath ls bye EOF` RemoteFile=`echo $Getval | grep $user | awk '{ print $NF }'` echo $RemoteFile you can change the grep parameter as per ur pattern ( date or something else) to filter the "ls" string. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|