PDA

View Full Version : ftp help needed


under_exposed
11th Mar 2005, 09:20
I am trying to use mget to pull some files that I know the start of the name but not the case of the start of the name.
Anybody know how to do this?

The Invisible Cat
11th Mar 2005, 12:52
It depends on what the remote system is.
If it's a UNIX (incl LINUX) system you could do something around :

mget [Ff][Oo][Oo]* assuming the file name starts with foo

Clue : experiment with ls beforehand

Excerpts from the ftp manpage below
You probably do not have access to it if you are on a Windows system, ortherwise RTFM ;)

glob Toggle filename expansion for mdelete, mget and mput. If
globbing is turned off with glob, the filename arguments are
taken literally and not expanded. Globbing for mput is done as
in csh(1). For mdelete and mget, each remote filename is
expanded separately on the remote machine and the lists are not
merged. Expansion of a directory name is likely to be different
from expansion of the name of an ordinary file: the exact result
depends on the foreign operating system and FTP server, and can
be previewed by doing:

mls remote-files -

Note: mget and mput are not meant to transfer entire directory
subtrees of files. That can be done by transferring a tar(1)
archive of the subtree (in binary mode).

ls [ remote-directory ] [ local-file ]
Print a listing of the contents of a directory on the remote
machine. The listing includes any system-dependent information
that the server chooses to include; for example, most UNIX
systems produce output from the command ls -lA. (See also
nlist.) If remote-directory is left unspecified, the current
working directory is used. If interactive prompting is on, ftp
prompts the user to verify that the last argument is indeed the
target local file for receiving ls output. If no local file is
specified, or if local-file is -, the output is sent to the
terminal.

mget remote-files
Expand the remote-files on the remote machine and do a get for
each filename thus produced. See glob for details on the
filename expansion. Resulting filenames are then processed
according to case, ntrans, and nmap settings. Files are
transferred into the local working directory, which can be
changed with lcd directory; new local directories can be created
with ! mkdir directory.

under_exposed
15th Mar 2005, 08:07
TIC, It is UNIX I am using, the remote is an unknown. Unfortunatly mget [Ff][Oo][Oo]* does not work.
mget myfile .txt will bring down a file regardless of case ONLY if globbing is switched off! We were hoping to use the case command to fold the names to lower case during the transfer.
Tried RTFM, TFM is now in the bin!

RomeoTangoFoxtrotMike
17th Mar 2005, 12:13
I am trying to use mget to pull some files that I know the start of the name but not the case of the start of the name.
Does the DIR command not work ?