From owner-freebsd-questions Mon Oct 12 19:39:11 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA09879 for freebsd-questions-outgoing; Mon, 12 Oct 1998 19:39:11 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from phoenix.welearn.com.au (suebla.lnk.telstra.net [139.130.44.81]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA09863 for ; Mon, 12 Oct 1998 19:39:04 -0700 (PDT) (envelope-from sue@phoenix.welearn.com.au) Received: (from sue@localhost) by phoenix.welearn.com.au (8.9.1/8.9.0) id MAA04966; Tue, 13 Oct 1998 12:38:26 +1000 (EST) Message-ID: <19981013123821.07082@welearn.com.au> Date: Tue, 13 Oct 1998 12:38:22 +1000 From: Sue Blake To: Studded Cc: Norman C Rice , freebsd-questions@FreeBSD.ORG Subject: Re: ftp get filenames with spaces and junk text References: <19981012175615.48311@welearn.com.au> <19981012105901.A26212@emu.sourcee.com> <19981013053326.50449@welearn.com.au> <36227686.42C5934D@gorean.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e In-Reply-To: <36227686.42C5934D@gorean.org>; from Studded on Mon, Oct 12, 1998 at 02:37:10PM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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