I want to redirect ls of server ftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting I want to redirect ls of server ftp
# 8  
Old 03-06-2009
Quote:
Originally Posted by protocomm
Yes vgersh99 i trie and it's good, it does that i want....thanks a lot for your answers...
It's not supposed to work the way you would expect it:
Code:
$ ftp localhost
Connected to localhost.
220 bbpser170 FTP server ready.
Name (localhost:pvdmart): myuser
331 Password required for myuser.
Password:
230 User myuser logged in.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd /tmp
250 CWD command successful.
ftp> ls > foo
200 PORT command successful.
550 >: No such file or directory.
ftp> quit

# 9  
Old 03-06-2009
it's true as you say it's don't work, the answer of cfjohanson works as i expect...
i learn all days, i'm a beginner and send a <<EOF command in a file by just > ,it's great....thanks
# 10  
Old 03-07-2009
'man ftp' yields:
Code:
     ls [ remote-directory | -al ] [ local-file ]
           Prints an abbreviated listing of  the  contents  of  a
           directory  on  the remote machine. If remote-directory
           is left unspecified, the current working directory  is
           used.

           The -a option lists all entries, including those  that
           begin  with  a dot (.), which are normally not listed.
           The -l option lists files in long format, giving mode,
           number of links, owner, group, size in bytes, and time
           of last modification for each file. If the file  is  a
           special  file,  the  size  field  instead contains the
           major and minor device numbers rather than a size.  If
           the  file  is a symbolic link, the filename is printed
           followed by "->" and the pathname  of  the  referenced
           file.

           If no local file is specified, or if local-file is  -,
           the output is sent to the terminal.

Code:
#!/bin/bash

ftp -n << EOF
open F3MONTK2SVK-01
user movie ""
binary
ls . /Users/eric
bye
EOF

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ftp redirect

Hi i want to redirect a list of ftp file to an exsisting file by mls x.txt mylocalfile.txt result of this command corrupt my data on mylocalfile.txt , please help me (2 Replies)
Discussion started by: rezasadeghi
2 Replies

2. Shell Programming and Scripting

How to redirect the output of a command inside ftp block?

hi, i am using ftp to get files from remote server. inside the ftp i want to us ls -ltr command and send the output of it to a file. ftp -n remote_server <<_FTP quote USER username quote PASS password prompt noprompt pwd ls -ltr get s1.txt bye _FTP i... (4 Replies)
Discussion started by: Little
4 Replies

3. Shell Programming and Scripting

How to redirect output of a command to a variable during ftp mode?

Hi, How can I redirect the output of a following command to a variable. ftp myservername ftp> user (username) guptaji 331 Password required for guptaji. Password: ftp> size /home/salil/abc.dat ftp> a='size /home/salil/abc.dat' ?Invalid command I want to redirect value of size to... (1 Reply)
Discussion started by: Salil Gupta
1 Replies

4. Red Hat

Implement FTP server on RHEL server without using FTP client

We have RHEL 5.8 in our environment, I had a query whether we can implement an FTP server using vsftpd package and Linux configurations like setsebool without using any external FTP clients like FileZilla etc. I am very confused on this. The FTP functionalities that should be present are download &... (3 Replies)
Discussion started by: RHCE
3 Replies

5. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

6. Windows & DOS: Issues & Discussions

Office server => laptop =>client server ...a lengthy and laborious ftp procedure

Hi All, I need your expertise in finding a way to solve my problem.Please excuse if this is not the right forum to ask this question and guide me to the correct forum,if possible. I am a DBA and on a daily basis i have to ftp huge dump files from my company server to my laptop and then... (3 Replies)
Discussion started by: kunwar
3 Replies

7. Red Hat

when users ftp to server the timezone reflected is UTC but the server is set to TZ in localtime

Guys, Need your help coz my server runs in local time GMT +8, but when client use ftp and login, the resulting timestamp seen in each file is in UTC format. We need to set that the time should be the same as GMT +8 when in ftp session. I am using RHEL 5.3. root@]# ll total 1740... (2 Replies)
Discussion started by: shtobias
2 Replies

8. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

9. Shell Programming and Scripting

ftp script not able to connect to ftp server.

I have the following ftp script to get files from a remote location. However, on running the script I find that I am not even able to connect to ftp server. I am able to connect to ftp server using other GUI ftp tools like WS_FTP using the same IP. IP used here is a dummy IP. What can go... (3 Replies)
Discussion started by: gram77
3 Replies

10. Shell Programming and Scripting

redirect output of FTP

Hi, I call the FTP command from within a script. The call to FTP looks like this : ftp -n -i -v < $com >> "$logfile" Where $com is a commandfile and I want the output to be redirected to $logfile. If I do this call at the prompt it works perfect. (replacing the variables by there... (4 Replies)
Discussion started by: kcaluwae
4 Replies
Login or Register to Ask a Question