Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Oct 1998 12:38:22 +1000
From:      Sue Blake <sue@welearn.com.au>
To:        Studded <Studded@gorean.org>
Cc:        Norman C Rice <nrice@emu.sourcee.com>, freebsd-questions@FreeBSD.ORG
Subject:   Re: ftp get filenames with spaces and junk text
Message-ID:  <19981013123821.07082@welearn.com.au>
In-Reply-To: <36227686.42C5934D@gorean.org>; from Studded on Mon, Oct 12, 1998 at 02:37:10PM -0700
References:  <19981012175615.48311@welearn.com.au> <19981012105901.A26212@emu.sourcee.com> <19981013053326.50449@welearn.com.au> <36227686.42C5934D@gorean.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 12, 1998 at 02:37:10PM -0700, Studded wrote:
> Sue Blake wrote:
> 
> > The standard ftp client has a feature which can be activated to rename
> > all files automatically as it writes them to the local disk. I want to
> > learn how to use this feature of ftp. It is simple, and documened, but
> > I don't understand the syntax.
> 
>   get remote-file [local-file]
>                  Retrieve the remote-file and store it on the local
> machine.
>                  If the local file name is not specified, it is given
> the same
>                  name it has on the remote machine. . . 
> 
> Perhaps it is just too simple. It is a well established documentation
> convention that anything in [square brackets] is an optional parameter
> to a command. That is what the documentation refers to when it says that
> if the local name is not specified, it gets the same name as the remote
> file on your local machine. So, if you want to download "silly file with
> spaces" and store it as "not_so_silly" on your machine, you'd do:
> 
> ftp> get silly file with spaces not_so_silly
> 
> 	I *imagine* but wouldn't swear to ftp being smart enough to recognize
> the first bit as the file name and not try to get a file called "silly
> file with spaces not_so_silly" however I haven't tested it. It might be
> necessary to put the filename on the remote machine in quotes. If it
> doesn't work at all even with the quotes, it's a bug and you should send
> a PR on it. 

No, it's not that smart. The whole name needs to be quoted or else it
thinks they're separate files.
ftp> get "silly file with space" not_so_silly
seems to be the way. That's a big help for individual files.

I've finally worked out how to automate it!

ftp> ntrans " " _
ftp> get "silly file name"
local: silly_file_name remote: silly file name
200 PORT command successful
                            (more simple 'get "name"' commands here)
226 Transfer complete
ftp> quit
bash$ ls sil*
silly_file_name


I still can't see how to deal with strange characters that I can't
type, though that's less urgent. It's hard to see how to combine
wildcards with quoted filenames. The mac ftp server misunderstands
wildcards anyway (I think it's treating asterisks as letters). There's
still more stuff in the ftp man page that might be usable by someone
else, not me.



-- 

Regards,
        -*Sue*-


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981013123821.07082>